Skip to content

React hook that adds local storage support to the `useReducer` hook

Notifications You must be signed in to change notification settings

Tweries/useReducerWithLocalStorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

useReducerWithLocalStorage

React hook that adds local storage support to the useReducer hook

Install

yarn add use-reducer-with-local-storage

Usage

const [state, dispatch] = useReducerWithLocalStorage({
  initializerArg: emptyState,
  key: 'REACT_APP_STATE',
  reducer
});

Resources

Notes

  • Special thanks to Matthew Brooks that was kind enough to review the original Gist and to propose new features.

About

React hook that adds local storage support to the `useReducer` hook

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published