-
Notifications
You must be signed in to change notification settings - Fork 28
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
Saga Support #43
Comments
I can expose any extra hooks this |
I'm trying to figure out exactly where in the react-isormorphic-render code this should live. I think here? It is essentially after all the preload methods have been triggered you have to run the |
Is the only missing thing is running |
As for the place I'd suggest adding a hook here: It's after all preloads but before |
That should work!
The best would be to have a hook there that provided the store. Thanks :) |
Try the newest version and beforeRender({ dispatch }) { return dispatch(END) } (I didn't test it) |
Awesome thank you! I will give it a go :) |
How is saga integration possible now that |
@chris-allen |
Your platform has been working very nicely! I appreciate all the thought put into it.
One thing I'd love to see is Saga support. Sagas tend to be a lot easier to manage then the more 'thunk' like pattern (https://github.com/redux-saga/redux-saga), especially when you want to chain events.
I got very close to getting them working with the platform (thanks to all the middleware hooks etc). But there is a missing piece that revolves around saga's working server side: redux-saga/redux-saga#13.
Saga's Resolution: redux-saga/redux-saga#255
Essentially server side rendering and Sagas have some challenges, but they have a special 'END' event that needs to be triggered at specific point in the code.
More specifically
dispatch(end)
Example code from the saga issue 255 linked above:
Another challenge that I had mostly worked around was the fact that Saga's don't return promises by default which are required by the Preload decorators. But I created a helper file that can take care of that because when you call
this.sagaMiddleware.run(common)
it returns the associated promise, which I then save and can be returned in the 'preload' methods. (Tho there might be some trickery I hadn't gotten to around preload running client side?)In summary: Saga support would be awesome :)
The text was updated successfully, but these errors were encountered: