Created
July 6, 2019 18:14
-
-
Save jsmanifest/0978d42f02ae8ccf570c1c7387b5580a to your computer and use it in GitHub Desktop.
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 { useReducer } from 'react' | |
| const initialState = { | |
| // | |
| } | |
| const reducer = (state, action) => { | |
| switch (action.type) { | |
| default: | |
| return state | |
| } | |
| } | |
| const useSomeHook = () => { | |
| const [state, dispatch] = useReducer(reducer, initialState) | |
| return { | |
| ...state, | |
| } | |
| } | |
| export default useSomeHook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment