Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Action observation order for reducer and side effects #92

Open
gwright opened this issue Oct 5, 2019 · 0 comments
Open

Action observation order for reducer and side effects #92

gwright opened this issue Oct 5, 2019 · 0 comments

Comments

@gwright
Copy link

gwright commented Oct 5, 2019

The FAQ regarding reducers and side effects says:

Technically speaking Reducer gets every Action from upstream before the registered SideEffects. The idea behind this is that a Reducer may have already changed the state before a SideEffect start processing the Action.

In looking through the code this behavior seems to hang entirely on the fact that PublishSubject stores its subscribers in an array, multicasts events to subscribers in array order, and the reducer is the first subscriber. I don't think that behavior is part of the public API for PublishSubject. For example, see ReactiveX/RxJava#1662 (comment)

I'm still learning about RxJava and am even more naive about RxRedux so I may be missing something here. If my observations are correct, I think the implementation of ObservableReduxStore#subscribeActual should be refactored to ensure actions are reduced before being multicast to the side effect subscribers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant