We want to remove entries from ThreadActivityStore once the threads have been removed.
Details
Details
Navigate to thread, log ThreadActivityStore, delete thread, log ThreadActivityStore.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- master
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
lib/reducers/thread-activity-reducer.js | ||
---|---|---|
37–40 | Maybe this check is superfluous and we should just let execution spill into the subsequent for loop? I guess this prevents state pointing to different object if there are no updates, but there will almost certainly be updates with leaveThreadActionTypes.success and deleteThreadActionTypes.success? Can remove this if preferred |
lib/reducers/thread-activity-reducer.js | ||
---|---|---|
37–40 | No it's better to keep this. If for instance there is a useSelector(state => state.threadActivityStore) (or a createSelector equivalent), they would be able to "short-circuit" and skip any changes here because you're returning the exact same state object. If you remove it here, that "short-circuit" will be gone |