I hereby claim:
- I am mboettcher on github.
- I am martinboettcher (https://keybase.io/martinboettcher) on keybase.
- I have a public key ASCaWAVdggTuCXuY75qwhdCdBzOnn7D4q989f1uFmu9KMwo
To claim this, I am signing this object:
| import { useEffect, useState } from 'react'; | |
| import { NavigationParams, NavigationRoute, NavigationScreenProp } from 'react-navigation'; | |
| export const useIsScreenFocused = (navigation: NavigationScreenProp<NavigationRoute<NavigationParams>, NavigationParams>) => { | |
| const [isFocused, setIsFocused] = useState(true); | |
| useEffect(() => { | |
| const focusListener = navigation.addListener('didFocus', () => { | |
| setIsFocused(true); | |
| }); | |
| const blurListener = navigation.addListener('didBlur', () => { |
| import { useEffect } from 'react'; | |
| import { NavigationParams, NavigationRoute, NavigationScreenProp } from 'react-navigation'; | |
| export const useFocusEventRefresh = ( | |
| navigation: NavigationScreenProp< | |
| NavigationRoute<NavigationParams>, | |
| NavigationParams | |
| >, | |
| refetch: () => Promise<any>, | |
| ) => { |
| import { useState, useEffect } from 'react'; | |
| const defaultSettings: PositionOptions = { | |
| enableHighAccuracy: false, | |
| timeout: Infinity, | |
| maximumAge: 0, | |
| }; | |
| export const usePosition = (watch = false, settings = defaultSettings): {position: Position, error: string} => { |
| import { useEffect, useRef } from 'react'; | |
| export function useIsMountedRef() { | |
| const isMountedRef = useRef(false); | |
| useEffect(() => { | |
| isMountedRef.current = true; | |
| return () => { | |
| isMountedRef.current = false; | |
| }; | |
| }, []); |
I hereby claim:
To claim this, I am signing this object: