ngrx / store

RxJS powered state management for Angular applications, inspired by Redux
MIT License
3.9k stars 310 forks source link

Actions moves back the state of the action that has been resolved #452

Closed criticalbh closed 7 years ago

criticalbh commented 7 years ago

Lets say we have: ACTION1 ACTION1_SUCCESS ACTION2 ACTION2_SUCCESS

ACTION1 is dispatched and activate effects to load data for action1. ACTION2 is dispatched and it activates effect to load data for action2.

ACTION2_SUCCESS is dispatched since ACTION2 finished first.

now when ACTION1_SUCCESS is dispatched it puts back the state of ACTION2_SUCCESS to previous state.

Could anyone please give me some ideas why this happens?

Please take a look at photo: '--- | --- | ---' is subscription to selector. image

criticalbh commented 7 years ago

Forget please

        default: {
            return initialState;
        }