Skip to content

Conversation

@joannalauu
Copy link
Contributor

PR Checklist

  • Commit message follows our contributing guidelines
  • Tests added/updated (for bug fixes/features)
  • Documentation added/updated (for bug fixes/features)

PR Type

  • Bug fix
  • Feature
  • Style update
  • Refactor
  • Test
  • Build
  • CI
  • Docs
  • Performance
  • Other (please describe)

Current behavior

Fixes: #2109

New behavior

Selector factories now use defaultMemoize for caching

Breaking change?

  • Yes
  • No

Additional context

@joannalauu joannalauu requested a review from a team as a code owner January 12, 2026 02:51
@joannalauu joannalauu force-pushed the feat/defaultMemoize-cache branch from fa3dba9 to 8b82879 Compare January 12, 2026 03:15
Copy link
Member

@griest024 griest024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks mostly good, explicit typing reduces readability somewhat

Comment on lines +25 to +28
export const getDaffCartFeatureSelector: <
T extends DaffCart = DaffCart,
V extends DaffCartOrderResult = DaffCartOrderResult,
>() => DaffCartFeatureMemoizedSelectors<T, V> = defaultMemoize(<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to explicitly type getDaffCartFeatureSelector here? Does memoized not have the correct type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were errors with the implicit type not being recognized when importing the selector to another function, which is why I added explicit types to all the imports.

Copy link
Member

@griest024 griest024 Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes,

function defaultMemoize(projectionFn:   AnyFn, ...)

ngrx does not type defaultMemoize strongly enough

Copy link
Member

@griest024 griest024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm but needs signed commits

@joannalauu joannalauu force-pushed the feat/defaultMemoize-cache branch from 8b82879 to 68b976f Compare January 15, 2026 23:51
@joannalauu joannalauu requested a review from griest024 January 15, 2026 23:51
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.

Selector factories should use defaultMemoize for caching

3 participants