-
-
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
doc improvements for saga vs thunk, handling simple cases #60
Comments
@aft-luke I like the one-to-one comparison. Using a login example highlights the differences between I'm just starting out with Should it appear in the docs? As a new user I think it would help to have a one-to-one example from If it would be a welcome addition, I wouldn't mind working on a PR to use gitbook for documentation. The cost would be harder upkeep of the docs (e.g. making sure these types of examples still work, etc). There is a certain beauty about keeping all the documentation in a single README.md, but by using something like gitbook these additional examples can be added in without worrying about bloat. |
Sagas that milmics the thunk callbacks are generally wrapped inside a while(true). the examples dir re-implement some of the original redux/thunk examples so I don't think there is a lack on this side. although I agree there is a lack on the docs side: step by step tutorials; showcase of complex flow implementations; handling common concurrency concerns...)
Didn't work with gitbook before; but from the site docs, it seems like publishing gitbooks isn't done in the Github repo but instead on the gitbook site https://github.com/GitbookIO/gitbook#publish-your-book. Of course any contribution is welcome |
The site is optional, you can totally make it work with Github Pages. You can check out |
I'm new to |
@danscan yeap; API docs is terribly lacking; hope to do it soon. |
opened #70 to centralize feedback |
also will close this; feel free to add your suggestions to #70 |
@danscan there is a new section for API docs http://yelouafi.github.io/redux-saga/docs/api/index.html Will be adding more content later |
This seems like some low hanging fruit that would aid newcomers.
When reading the docs it's not immediately clear to me how to use a saga in "the simplest case". By simplest case I mean there is a view button that triggers a callback, and that callback has async behavior. In a redux-thunk implementation, that callback would be a bound action creator with some middleware to handle the async nature of the callback:
The docs say
redux-saga
is a replacement/alternative forredux-thunk
or other middlewares, and neatly explains how sagas are a much more powerful construct, especially when dealing with longer running sequences of events. However, it's not immediately clear whether the use case of "one event, one action" also falls under a saga's domain, or how we might implement that case. This is how I would do it, but I'm open to suggestions:First, is this the "right way" to make a one-to-one, or is there a cleaner approach than having an explicit "start this saga" action creator callback? Second, do you think this is something that should appear in the docs?
The text was updated successfully, but these errors were encountered: