Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created July 6, 2019 18:14
Show Gist options
  • Select an option

  • Save jsmanifest/0978d42f02ae8ccf570c1c7387b5580a to your computer and use it in GitHub Desktop.

Select an option

Save jsmanifest/0978d42f02ae8ccf570c1c7387b5580a to your computer and use it in GitHub Desktop.
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