-
-
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
createSelector type error with selectIds from .adapter.getSelectors() #525
Comments
Did you change the interface type for the |
@brandonroberts no, the |
platform/modules/entity/src/models.ts Lines 68 to 84 in f50690f
Changing the code above with this code resolves the issue: export type EntitySelectors<T, V> = {
selectEntities: (state: V) => Dictionary<T>;
selectAll: (state: V) => T[];
selectTotal: (state: V) => number;
selectIds: (state: V) => string[] | number[];
}; |
For anyone else who gets a type error: "Cannot invoke an expression whose type lacks a call signature", the union in the selectIds type that was changed in #533 is I believe the issue.
Current workaround is to escape the type for getProductIds: @brandonroberts do you have a better suggestion for getting access to Array commands without triggering the type error? |
I'm submitting a...
What is the current behavior?
Adding a selector with
selectIds
from.adapter.getSelectors()
throws a type error.Using the
example-app
:Error:
Version of affected browser(s),operating system(s), npm, node and ngrx:
@ngrx/entity 4.1.0
The text was updated successfully, but these errors were encountered: