text: var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=useFocusEffect;var React=_interopRequireWildcard(require("react"));var _useNavigation=_interopRequireDefault(require("./useNavigation"));function useFocusEffect(callback){var navigation=(0,_useNavigation.default)();React.useEffect(function(){var isFocused=false;var cleanup;if(navigation.isFocused()){cleanup=callback();isFocused=true;}var unsubscribeFocus=navigation.addListener('focus',function(){if(isFocused){return;}if(cleanup!==undefined){cleanup();}cleanup=callback();isFocused=true;});var unsubscribeBlur=navigation.addListener('blur',function(){if(cleanup!==undefined){cleanup();}cleanup=undefined;isFocused=false;});return function(){if(cleanup!==undefined){cleanup();}unsubscribeFocus();unsubscribeBlur();};},[callback,navigation]);}
  //# sourceMappingURL=useFocusEffect.js.map