Skip to content

Commit

Permalink
refactor(createSelector): rename resultFunc to projector.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixbyron committed Aug 20, 2017
1 parent 7deeedd commit a159721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/store/spec/selector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Selectors', () => {
const projectFn = jasmine.createSpy('projectionFn');
const selector = createSelector(incrementOne, incrementTwo, projectFn);

selector.resultFunc('', '');
selector.projector('', '');

expect(incrementOne).not.toHaveBeenCalled();
expect(incrementTwo).not.toHaveBeenCalled();
Expand Down
6 changes: 3 additions & 3 deletions modules/store/src/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type AnyFn = (...args: any[]) => any;
export interface MemoizedSelector<State, Result>
extends Selector<State, Result> {
release(): void;
resultFunc: AnyFn;
projector: AnyFn;
}

export function memoize(t: AnyFn): { memoized: AnyFn; reset: () => void } {
Expand Down Expand Up @@ -135,7 +135,7 @@ export function createSelector(...args: any[]): Selector<any, any> {

return Object.assign(memoizedState.memoized, {
release,
resultFunc: memoizedProjector.memoized,
projector: memoizedProjector.memoized,
});
}

Expand All @@ -146,5 +146,5 @@ export function createFeatureSelector<T>(
return state[featureName];
});

return Object.assign(memoized, { release: reset, resultFunc: memoized });
return Object.assign(memoized, { release: reset, projector: memoized });
}

0 comments on commit a159721

Please sign in to comment.