import { useCollector } from '@craftjs/utils' ; import { useContext , useMemo } from 'react' ; import { LayerManagerContext } from './context' ; import { LayerState } from '../interfaces' ; export function useLayerManager < C > ( collector ? ) { const { store } = useContext ( LayerManagerContext ) ; const collected = useCollector ( store , collector ) ; return useMemo ( ( ) => ( { store , ... collected , } ) , [ store , collected ] ) ; }