HomePhabricator
Diffusion Comm de3b477b669f

[native] Don't call dispatch from reducer

Description

[native] Don't call dispatch from reducer

Summary: Originally, this diff was just making sure that the dispatch didn't occur before REHYDRATE. But when testing that change I found that calling dispatch from a reducer triggered an error. More context in this comment, but this diff is now just removing the dispatch, with the expectation that the error-handling functionality here will be improved following the work in ENG-1974.

Test Plan:
I tested to make sure the app was still killed if an exception was thrown. I also tested that the dispatch error did not get thrown anymore:

You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.

Reviewers: atul, tomek, kamil

Reviewed By: atul, kamil

Subscribers: jacek, marcin, kamil

Differential Revision: https://phab.comm.dev/D5672

Details

Provenance
ashoatAuthored on Nov 18 2022, 6:20 AM
Reviewer
atul
Differential Revision
D5672: [native] Don't call dispatch from reducer
Parents
rCOMM9d1ff85e55d0: [native] Allow getDevServerHostname to be called from release mode
Branches
Unknown
Tags
Unknown