Skip to content

Commit

Permalink
✏️ seems like the 'storage' event doesn't work between tabs for this?,
Browse files Browse the repository at this point in the history
…resolve #1
  • Loading branch information
astoilkov committed Jun 2, 2023
1 parent 5b4ca0d commit 63df04a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ npm install use-session-storage-state@17
- Clone of [`use-local-storage-state`](https://github.com/astoilkov/use-local-storage-state) that I've been [maintaining for the past 2 years](https://github.com/astoilkov/use-local-storage-state/graphs/contributors).
- React 18 concurrent rendering support.
- SSR support.
- Handles the `Window` [`storage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) event and updates changes across browser tabs, windows, and iframe's. Disable with `storageSync: false`.
- Handles the `Window` [`storage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) event and updates changes across iframe's. Disable with `storageSync: false`.
- In-memory fallback when `sessionStorage` throws an error and can't store the data. Provides a `isPersistent` API to let you notify the user their data isn't currently being stored.
- Aiming for high-quality with [my open-source principles](https://astoilkov.com/my-open-source-principles).

Expand Down Expand Up @@ -172,7 +172,9 @@ Type: `boolean`

Default: `true`

Setting to `false` doesn't subscribe to the [Window storage event](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event). If you set to `false`, updates won't be synchronized across tabs, windows and iframes.
Setting to `false` doesn't subscribe to the [Window storage event](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event). If you set to `false`, updates won't be synchronized across iframes.

Note: Unlike `localStorage`, `sessionStorage` doesn't fire the `storage` event across tabs and windows.

### `options.serializer`

Expand Down

0 comments on commit 63df04a

Please sign in to comment.