diegohaz / redux-saga-thunk

Dispatching an action handled by redux-saga returns promise
MIT License
221 stars 17 forks source link

Fix reducer bug in case of use optional thunk id. #36

Open VitaliiSubochev opened 5 years ago

VitaliiSubochev commented 5 years ago

In case of use optional thunk identifier, reducer not update properly state i.e. request action not pass to any state from pending state.

codecov-io commented 5 years ago

Codecov Report

Merging #36 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #36   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines         134    135    +1     
  Branches       46     46           
=====================================
+ Hits          134    135    +1
Impacted Files Coverage Δ
src/reducer.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 329befe...06cc9a1. Read the comment docs.

diegohaz commented 5 years ago

Hi @vitalystr. Thank you for the PR. Could you please write a test that illustrates your use case?

VitaliiSubochev commented 5 years ago

As I understand it a problem in compiled code in /dist folder on /src it works great. Chunk of code if (!value) { newValue = { ...substate[name] } delete newValue[id] } else { newValue = { ...substate[name], [id]: true } } compile into if (!value) { newValue = _extends({}, substate[name]); delete newValue[id]; } else { newValue = _extends({}, substate[name], _defineProperty({}, id, true)); }

and its not work in my app.