From 63df04afebffb9b2b9d7b7c19ccb1d94094b6326 Mon Sep 17 00:00:00 2001 From: Antonio Stoilkov Date: Fri, 2 Jun 2023 15:54:48 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20seems=20like=20the=20'stor?= =?UTF-8?q?age'=20event=20doesn't=20work=20between=20tabs=20for=20this=3F,?= =?UTF-8?q?=20resolve=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 6e81e40..175af72 100644 --- a/readme.md +++ b/readme.md @@ -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). @@ -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`