Add new hook for production ISU login

This commit is contained in:
Philipp Stracker 2024-12-05 15:05:00 +01:00
parent a8f12c63fa
commit 05c1978f0d
No known key found for this signature in database
3 changed files with 38 additions and 1 deletions

View file

@ -34,8 +34,12 @@ const useHooks = () => {
setProducts,
} = useDispatch( STORE_NAME );
// Read-only flags.
// Read-only flags and derived state.
const flags = useSelect( ( select ) => select( STORE_NAME ).flags(), [] );
const determineProducts = useSelect(
( select ) => select( STORE_NAME ).determineProducts(),
[]
);
// Transient accessors.
const isReady = useTransient( 'isReady' );
@ -80,6 +84,7 @@ const useHooks = () => {
);
return savePersistent( setProducts, validProducts );
},
determineProducts,
};
};
@ -123,3 +128,9 @@ export const useNavigationState = () => {
business,
};
};
export const useDetermineProducts = () => {
const { determineProducts } = useHooks();
return determineProducts;
};