import { useCallback } from 'react' ; import { useSelector } from './useSelector' ; import type { Reducer } from '../..' ; export const useStoreSelector = < TState extends any , TPayload extends any > ( store , selector ) => { const memoizedSelector = useCallback ( ( stores ) => { return selector ( stores [ store . storeName ] ) ; } , [ store , selector ] ) ; return useSelector ( store , memoizedSelector ) ; } ;