Description
Hello,
I have some problem with the call orders of Observable.
My case:
I have 2 components, Comp1 and Comp2.
Comp1 is a text search component.
Comp2 is a display of a text.
Comp1 and Comp2 share the same reducer, with the following state:
{ match: number, search_element: string }
Comp1 dispatches Action1 when user enter text in input. Payload is the text and updates search_element.
Comp2 subscribe to search_element. It dispatches Action2 with the number of match in the payload, updates math in the state.
Comp1 subscribe to match.
The problem is subscribe to march is called twice.
First with the value from Comp2 and second from the initial value coming from Action1.
Comp1 displays the wrong match.
I don't understand why subscribe to match is called first with "state2" and then with "state1".
I had to add another flag, search_text_updated, to update match only with state2 value.
Do you have any clue if this is a normal behaviour, for chaining actions?
I will try to create an example to reproduce the issue.
Thanks,
Pierre