Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/cvpcasada/use-storage-event
- Owner: cvpcasada
- License: mit
- Created: 2020-02-04T11:57:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T06:26:07.000Z (about 2 years ago)
- Last Synced: 2024-11-11T05:17:33.449Z (3 months ago)
- Topics: events, localstorage, react, react-hook
- Language: TypeScript
- Size: 1.37 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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}
;
};
```