-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Ho to avoid 'Selector has alread been set'? #252
Comments
OnInitializedAsync is being executed multiple times on the same object instance? |
I have a small example here that can be used to reproduce the behavior. Just start the application and switch to the counter page. https://github.com/handcraftedsource/selector-exception-sample Another thing I noticed: it seems like I can't use IStateSelection alone, the component needs to have IState injected as well. |
AddScoped should have been AddTransient. I have added some other new things in there too, but need to write some unit tests when I am not busy. |
Could you try 5.1.0-Beta1 and let me know if it solves your problem? |
Yes the problem seems to be fixed with this version. Thanks for the quick fix. 👍 |
I used the new feature
IStateSelector<TState, TValue>
.I have called
Select
inOnInitializedAsync
of the Component on the injected property. The component is instantiated multiple times. If I switch from the first to the second component, I get an exception.Is there any way to determine if selector is already set?
The text was updated successfully, but these errors were encountered: