This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type ReturnTypes<T> = { | |
[P in keyof T]: T[P] extends (...args: any[]) => any | |
? ReturnType<T[P]> extends PromiseLike<infer U> | |
? U | |
: ReturnType<T[P]> | |
: T[P]; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Animated, Easing, EasingFunction} from 'react-native'; | |
import {useEffect, useRef} from 'react'; | |
const DEFAULT_ANIMATION_DURATION = 300; | |
const DEFAULT_EASING_FUNCTION = Easing.bezier(0.17, 0.67, 0.35, 0.92); | |
export function useBooleanAnimation( | |
value: boolean, | |
{ | |
duration = DEFAULT_ANIMATION_DURATION, |
OlderNewer