-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix browser errors about async responses
fixes #303 The issue was that the deferred listener abstraction would `return true` (telling the browser to expect an async response) for every message, even if the messages were not from the library. In `wrapStore()`, those messages would be ignored causing the browser to log an error: Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received This is mostly harmless, but it's better to avoid the error. In this commit, `createDeferredListener()` now takes a `filter` function that determines if the message will be handled so that messages from outside the library can be ignored. This requires a breaking change: moving the `channelName` argument to `createWrapStore()`. This is required since the filter function needs to know which channel to expect before `wrapStore()` is called.
- Loading branch information
1 parent
b3d01e8
commit e652ee1
Showing
5 changed files
with
111 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters