import { useCallback, useMemo, useState } from 'react';
export function useCollectionFilterInitialFetchTiming(props) {
    const { initialFetchTiming, collection } = props;
    useState(() => {
        if (!initialFetchTiming) {
            collection.initialFetch();
        }
    });
    const onFocus = useCallback(() => {
        initialFetchTiming === 'focus' && collection.initialFetch();
    }, [initialFetchTiming]);
    const skipInitialFetch = useMemo(() => initialFetchTiming === 'focus', [initialFetchTiming]);
    return {
        onFocus,
        skipInitialFetch,
    };
}
//# sourceMappingURL=useCollectionFilterInitialFetchTiming.js.map