Created
October 21, 2021 22:00
-
-
Save iamandrewluca/7d8cd2f345e705824b5c59a9378c9cb4 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
// eslint-disable-next-line react-hooks/rules-of-hooks | |
let _store: ReturnType<typeof useReducer> | |
function useStore() { | |
const store = useRef(useReducer((s: any, a: any) => { | |
return {} | |
}, {})) | |
_store = _store ?? store.current | |
return _store | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment