Edit: WIP docs are up, please review! https://github.com/redux-observable/redux-observable/pull/55
I strongly feel that the best and most powerful way to use redux-observable is with processManagers rather than thunkservables. Unfortunately, right now we're only documenting the thunkservable methodology.
I, personally, would like to deprecate the thunkservable method prior to RC, but I feel like @jayphelps might have different opinions.
Either way, we really need to document it in a first class way.
FYI people, I'm working on a huge overhaul of the docs that'll drop in the next week or two. If you're looking to help out, coordinate with us first so we don't double efforts. 👍
Here's a JSBin to demo and play with the new process manager feature: http://jsbin.com/nizova/edit?js,output
const fetchUserManager = action$ =>
action$.ofType(FETCH_USER)
.debounceTime(300)
.switchMap(action =>
ajax.getJSON(`https://api.github.com/users/${action.payload}`)
.map(fetchUserFulfilled)
.catch(({ xhr }) => of(fetchUserRejected(xhr.response)))
);
Thanks for the above example @jayphelps - super helpful in showing just what a processManager is.
I saw that you guys are still playing with the naming of them - I fully agree that processManager is quite a generic name and not exceedingly helpful in describing the feature. However, I don't come with criticism only, but rather another option for your naming list...
coordinate
verb
_kəʊˈɔːdɪneɪt/_
- bring the different elements of (a complex activity or organization) into a harmonious or efficient relationship.
I really feel like this describes what a the processManager is doing. Complex activity coordination.
So my recommendation for a new name is.... _drumroll_.... ✨ actionCoordinator ✨
I feel like I can infer the intentions of the feature from that name. My only grime with it is that "coordinator" is a fairly lengthy word that may be subject to typos.
Anyway, sorry for not being of more help to this awesome library. :) Feel free to completely trash my idea, just keep up the good work. ;)
Hey everyone subscribing, I've posted the WIP pull request here #55 that adds documentation via gitbook. Please check it out and leave any and all thoughts!
I think we should have a way to add in processManagers at runtime so we can support dynamically loaded routes.
Redux has replaceReducer to allow swapping in a different set of reducers at runtime.
I don't know if it is possible to fully swap out processManagers for a new set but if not then we should at least be able to add additional processManagers in at runtime.
I also wonder whether hot reloading requires a way to swap them all out?
@jeffbski there's an issue for this over at #52 and I had already put a pull request in for the latter of your ideas; for adding managers after initial creation - PR #53
@alisd23 Thanks for responding. I'm glad it is already in progress.
Docs are up! we'll have https://redux-observable.js.org but until then you can view them https://github.com/redux-observable/redux-observable/blob/master/docs/
Most helpful comment
Docs are up! we'll have https://redux-observable.js.org but until then you can view them https://github.com/redux-observable/redux-observable/blob/master/docs/