1.0.5-c • Published 7 months ago

@robertsspaceindustries/react-localsettings v1.0.5-c

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

react-localsettings

React's useState integrated with the localStorage API

Using react-localsettings

import useLocalSettings from "@robertsspaceindustries/react-localsettings";

/*
    react-localsettings stores your settings in one localStorage item, you can change the name of this item in the 3rd parameter
    the 1st parameter, settingName, is the name of the setting
    the 2nd parameter, settingValue, is the default value of the setting if not defined in localStorage
*/
const [state, setState] = useLocalSettings(settingName, settingValue, localStorageItem)

Note: react-localsettings saves your setting every time you set the state of it

1.0.5-c

7 months ago

1.0.5-b

8 months ago

1.0.5

8 months ago

1.0.4-c

8 months ago

1.0.4-b

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago