0.3.4 • Published 3 years ago

@har4s/use-local-storage v0.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Use Local Storage

A React Hook for using Browser Local/Session Storage

Installation

npm install @har4s/use-local-storage

or

yarn add @har4s/use-local-storage

Usage

import { useLocalStorage } from '@har4s/use-local-storage';
// or import { useSessionStorage } from '@har4s/use-local-storage';

export const Example = () => {
  // ...
  const [something, setSomething] = useLocalStorage('key', 'fallback');
  // or const [something, setSomething] = useSessionStorage('key', {...});
  // or const [something, setSomething] = useLocalStorage('key', 'fallback',{ persistent:false });
  // ...
};
0.3.2

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.1.4

3 years ago

0.2.4

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago