UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 2.5 kB
{"ast":null,"code":"\"use strict\";\n\nimport * as React from 'react';\nimport { useNavigation } from \"./useNavigation.js\";\nexport function useIsFocused() {\n var navigation = useNavigation();\n var subscribe = React.useCallback(function (callback) {\n var unsubscribeFocus = navigation.addListener('focus', callback);\n var unsubscribeBlur = navigation.addListener('blur', callback);\n return function () {\n unsubscribeFocus();\n unsubscribeBlur();\n };\n }, [navigation]);\n var value = React.useSyncExternalStore(subscribe, navigation.isFocused, navigation.isFocused);\n return value;\n}","map":{"version":3,"names":["React","useNavigation","useIsFocused","navigation","subscribe","useCallback","callback","unsubscribeFocus","addListener","unsubscribeBlur","value","useSyncExternalStore","isFocused"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/useIsFocused.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useNavigation } from './useNavigation';\n\n/**\n * Hook to get the current focus state of the screen. Returns a `true` if screen is focused, otherwise `false`.\n * This can be used if a component needs to render something based on the focus state.\n */\nexport function useIsFocused(): boolean {\n const navigation = useNavigation();\n\n const subscribe = React.useCallback(\n (callback: () => void) => {\n const unsubscribeFocus = navigation.addListener('focus', callback);\n const unsubscribeBlur = navigation.addListener('blur', callback);\n\n return () => {\n unsubscribeFocus();\n unsubscribeBlur();\n };\n },\n [navigation]\n );\n\n const value = React.useSyncExternalStore(\n subscribe,\n navigation.isFocused,\n navigation.isFocused\n );\n\n return value;\n}\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,aAAa;AAMtB,OAAO,SAASC,YAAYA,CAAA,EAAY;EACtC,IAAMC,UAAU,GAAGF,aAAa,CAAC,CAAC;EAElC,IAAMG,SAAS,GAAGJ,KAAK,CAACK,WAAW,CAChC,UAAAC,QAAoB,EAAK;IACxB,IAAMC,gBAAgB,GAAGJ,UAAU,CAACK,WAAW,CAAC,OAAO,EAAEF,QAAQ,CAAC;IAClE,IAAMG,eAAe,GAAGN,UAAU,CAACK,WAAW,CAAC,MAAM,EAAEF,QAAQ,CAAC;IAEhE,OAAO,YAAM;MACXC,gBAAgB,CAAC,CAAC;MAClBE,eAAe,CAAC,CAAC;IACnB,CAAC;EACH,CAAC,EACD,CAACN,UAAU,CACb,CAAC;EAED,IAAMO,KAAK,GAAGV,KAAK,CAACW,oBAAoB,CACtCP,SAAS,EACTD,UAAU,CAACS,SAAS,EACpBT,UAAU,CAACS,SACb,CAAC;EAED,OAAOF,KAAK;AACd","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}