-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
PollingController
to immediately call _executePoll
if no p…
…olling is currently active for the key on start (#1874) ## Explanation Currently when PollingController polling is started via `startPollingByNetworkClientId()`, the first poll execution doesn't occur until `intervalLength` time has passed. Some controllers such as the `CurrencyRateController` want to execute their polling logic immediately on polling start that way it is available to the UI as soon as possible. ~~This PR adds a `executeImmediately` flag to the `PollingController`. When set to `true`, it causes `_executePoll()` to immediately be called when `startPollingByNetworkClientId()` is called, subsequently on each `intervalLength` time period. This value defaults to false.~~ This PR updates `#poll()` to call `_executePoll()` if no polling is currently active for the key ## References * Related #1805 ## Changelog ### `@metamask/polling-controller` - **BREAKING**: `_executePoll()` is called immediately on start if no polling interval is already active for the networkClientId + options combination ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate --------- Co-authored-by: Elliot Winkler <[email protected]> Co-authored-by: Alex <[email protected]>
- Loading branch information
1 parent
fa106c5
commit 9e00912
Showing
6 changed files
with
148 additions
and
49 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
Oops, something went wrong.