Last active
February 10, 2019 23:56
-
-
Save amanda-mitchell/6ee451a559c57246259a3c96ee549370 to your computer and use it in GitHub Desktop.
This file contains 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
function useBoundEffect<TArguments extends any[]>( | |
effect: (...params: TArguments) => ReturnType<React.EffectCallback>, | |
...params: TArguments | |
) { | |
return useEffect(() => effect(...params), params); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment