-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Store): selector with only a projector #1579
Conversation
24f3f5a
to
864fc18
Compare
@@ -143,17 +143,6 @@ describe('Selectors', () => { | |||
}); | |||
}); | |||
|
|||
it('should not short circuit to the projector fn if there are no selectors and props', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was to verify the fix for #1501.
Since we don't short circuit anymore, this test became obsolete.
BREAKING CHANGE: Selectors with only a projector function aren't valid anymore. This change will make the usage more consistent. BEFORE: ``` const getTodosById = createSelector( (state: TodoAppSchema, id: number) => state.todos.find(p => p.id === id) ); ``` AFTER: ``` const getTodosById = createSelector( (state: TodoAppSchema) => state.todos, (todos: Todo[], id: number) => todos.find(p => p.id === id) ); ```
864fc18
to
3447f87
Compare
Preview docs changes for 3447f87 at https://previews.ngrx.io/pr1579-3447f87/ |
Will you put in another PR that deprecates the old method overload? |
Preview docs changes for 26eab59 at https://previews.ngrx.io/pr1579-26eab59/ |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #1558
What is the new behavior?
Does this PR introduce a breaking change?
BREAKING CHANGE:
Selectors with only a projector function aren't valid anymore.
This change will make the usage more consistent.
BEFORE:
AFTER: