Search code examples
ngrxngrx-store

Does memoization work on smple .select with strings?


So basically I am selecting a slice of my state using strings and am wondering if I still benefit from memoization, since the call should be pure.

this.store.select('state', 'loginFeature', 'loggedPerson').subscribe(loggedPerson => this.loggedPerson = loggedPerson);

Solution

  • No, memoization only happens within createSelectors.

    https://github.com/ngrx/platform/blob/master/modules/store/src/selector.ts#L82