See Usage here https://gist.github.com/SebastianHGonzalez/b440178f7f771e2930fa00974bc7176c
Last active
May 9, 2019 16:00
-
-
Save SebastianHGonzalez/35de95557030a72d04f64f73c2394aa9 to your computer and use it in GitHub Desktop.
UseApi hook
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
function useApi(callback, conditions) { | |
const api = new Api(Config); | |
return useEffect(() => callback(api), conditions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment