-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: big refactoring of
@_Memo
and @_AsyncMemo
cacheErrors/cacheRejections functionality is dropped. Previously it defaulted to true, so errors/rejections were cached and ensured "max 1 time execution". From now on errors are NOT cached, so, error-throwing functions will be executed multiple times. It's recommended to make sure they're idempotent! This is "for simplicity sake". .dropCache is replaced by `_getMemo().clear()` @_AsyncMemo now does NOT default to MapCache, and needs to pass cacheFactory explicitly. AsyncMemo now requires cache that implements AsyncMemoCache interface, which no longer supports sync execution (but only async). Important! @_Memo is proven (by tests) to be NOT prone to "async swarm" issue. (no change here) @_AsyncMemo WAS prone to "async swarm" issue, therefor it was refactored with significantly more complicated EXPERIMENTAL implementation that returns "in-flight promises" to avoid "async swarm". AsyncMemoCache now requires to return MISS symbol on cache misses. This allows it to support both `undefined` and `null` as cached values. Previously `undefined` was treated as MISS, which was ambiguous.
- Loading branch information
1 parent
38d6ffe
commit 1f795e1
Showing
9 changed files
with
309 additions
and
221 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
Oops, something went wrong.