🔥 Remove isSaving; move isBusy to common store

This commit is contained in:
Philipp Stracker 2024-11-21 16:14:26 +01:00
parent 10a3767e2f
commit 2b2b24e434
No known key found for this signature in database
7 changed files with 15 additions and 43 deletions

View file

@ -22,3 +22,13 @@ const usePersistent = ( key ) =>
( select ) => select( STORE_NAME ).persistentData()?.[ key ],
[ key ]
);
export const useBusyState = () => {
const { setIsBusy } = useDispatch( STORE_NAME );
const isBusy = useTransient( 'isBusy' );
return {
isBusy,
setIsBusy: useCallback( ( busy ) => setIsBusy( busy ), [ setIsBusy ] ),
};
};