Skip to content

Commit 4fab518

Browse files
authored
Merge pull request #310 from tshaddix/update-readme
Update note about createWrapStore
2 parents dbfb07f + 8dd6e06 commit 4fab518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ wrapStore(store);
7171
That's it! The dispatches called from UI component will find their way to the background page no problem. The new state from your background page will make sure to find its way back to the UI components.
7272

7373
> [!NOTE]
74-
> `createWrapStore()` sets up listeners for browser messaging. In MV3, it must be registered synchronously when the service worker starts. This ensures `dispatch()` calls that wake the service worker are received. Messages are queued internally until `wrapStore()` is called, and the events can be dispatched to the store.
74+
> `createWrapStore()` ensures webext-redux can handle events when the service worker restarts. It must be called statically in the global scope of the service worker. In other words, it shouldn't be nested in async functions, just like [any other Chrome event listeners](https://developer.chrome.com/docs/extensions/get-started/tutorial/service-worker-events#step-5).
7575
7676

7777
### 3. Optional: Apply any redux middleware to your *Proxy Store* with `applyMiddleware()`

0 commit comments

Comments
 (0)