Skip to content
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

[Help][Best practise] When/Where is the best location to dispatch createSignalRHub(hub) ? #104

Open
hocino opened this issue Aug 1, 2023 · 0 comments

Comments

@hocino
Copy link

hocino commented Aug 1, 2023

Hello,

I use Odonno on one project. I have one problem with the action createSignalRHub(hub).

I put this.store.dispatch(createSignalRHub(hub)); in the container of one component which needs signalr.
The first time when I display the component everything is good but when I come back a second time on this component, I dispatch a second time createSignalRHub(hub) and the effect link to signalrHubUnstarted an error is thrown because is enabled to add existing method.

I tried to dispatch createSignalRHub(hub) in a guard only when the hub doesn't exist, problem the selector selectHubStatuses doesn't work when *createSignalRHub(hub) is not yet dispatched.

So I think I misunderstood something... May you help me to know when or where dispatch createSignalRHub(hub) ? What is the good practise ?

Thanks a lot for your help

@hocino hocino changed the title [Best practise] When/Where is the best location to dispatch createSignalRHub(hub) ? [Help][Best practise] When/Where is the best location to dispatch createSignalRHub(hub) ? Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant