Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cvpcasada/use-storage-event

React hook for listening to window.on('storage') events
https://github.com/cvpcasada/use-storage-event

events localstorage react react-hook

Last synced: about 1 month ago
JSON representation

React hook for listening to window.on('storage') events

Awesome Lists containing this project

README

        

# use-storage-event

Listens to dom 'storage' event, see [MDN storage event docs](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event)

API (usage)

```js
import useStorageEvent from 'use-storage-event';

const App = () => {
const storageValue = useStorageEvent('storage-key');

return

{storageValue}

;
};
```