bjork_usecookie

A react hook for managing cookies

Usage no npm install needed!

<script type="module">
  import bjorkUsecookie from 'https://cdn.skypack.dev/bjork_usecookie';
</script>

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.

Licence

MIT