bjork_usecookie
v1.2.2
Published
A react hook for managing cookies
Downloads
7
Maintainers
Readme
What is this?
A React hook used for managing state and cookies simultaneously, effortlessly.
Install
Use npm to install bjork_useCookie or copy the code manually form github.
> npm i bjork_useCookie
Usage
Utilizes and, therefor, functions like Reacts useState. The difference being that setState takes a second, optional, param options that configures how the cookie is packaged. For more information checkout the function set at the dependancy bjork_cookie.
> import useCookie from 'bjork_usecookie'
>
> const [ state, setState ] = useCookie(_default_)
> setState(value, options?)
Contribution
Pull requests are welcome. For any considerable changes, please open an issue first to discuss what you would like to change.