Skip to content

Conversation

@markerikson
Copy link
Contributor

This PR:

  • Updates defaultMemoize to enable clearing both singletonCache and lruCache
  • Exposes a clearCache method on the generated memoized function
  • Updates the createSelector types to infer the actual type of the memoize function's return value, so that selector.memoizedResultFunc.clearCache() is correctly inferred and usable

This allows correct inference of any fields that the memoize
function may attach to its generated output function, such as
`selector.memoizedResultFunc.clearCache` with `defaultMemoize`.
@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #519 (d2721f4) into master (c9a5207) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #519   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          101       102    +1     
  Branches        24        24           
=========================================
+ Hits           101       102    +1     
Impacted Files Coverage Δ
src/defaultMemoize.ts 100.00% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants