"use strict";

exports.__esModule = true;
exports.useCollectionFilterInitialFetchTiming = useCollectionFilterInitialFetchTiming;
var _react = require("react");
function useCollectionFilterInitialFetchTiming(props) {
  const {
    initialFetchTiming,
    collection
  } = props;
  (0, _react.useState)(() => {
    if (!initialFetchTiming) {
      collection.initialFetch();
    }
  });
  const onFocus = (0, _react.useCallback)(() => {
    initialFetchTiming === 'focus' && collection.initialFetch();
  }, [initialFetchTiming]);
  const skipInitialFetch = (0, _react.useMemo)(() => initialFetchTiming === 'focus', [initialFetchTiming]);
  return {
    onFocus,
    skipInitialFetch
  };
}
//# sourceMappingURL=useCollectionFilterInitialFetchTiming.js.map