-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Selectors with parameters #8
Comments
Hi, I need to have a look at Thanks for reaching out! Kinds |
Hi, I have the same issue in my project. From looking at your code this is because your pickfactory only accepts selectors without props. pick<TState, TResult>(selector: MemoizedSelector<TState, TResult>) {
return store.pipe(select(selector));
} This would be the pick function for a selector with props: pick<TState, TProps, TResult>(selector: MemoizedSelectorWithProps<TState, TProps, TResult>, props: TProps) {
return store.pipe(select(selector), props);
} For now there is no way around it, you will have to use the store normally unfortunately. |
Hi Omar, thanks for providing the sample. Please give me a few days to integrate this to the duck library. |
Hi together, there are two different ways using parameters with selectors. For now, I will implement Cheers |
|
Closing this issue for now. |
Hello,
thank you for the Duck classes which offer a good layer to work with the state. We use it throughout our application :)
One thing I didn't get into a duck is a selector with parameters. For example:
When just assigning it in the Duck as a property you cannot pass the parameters and the type of the proeprty for TypeScript is "never" (because the selector type is MemoizedSelectorWithProps).
I tried to create a function but in the Duck I have no access to this.pipe or even this.store:
So I ended up injecting the store again in some other service class and using the original selector.
It would be nice if a selector with parameters could also be accessed using a Duck class. Any ideas?
The text was updated successfully, but these errors were encountered: