salsita / prism

React / Redux action composition made simple http://salsita.github.io/prism/
495 stars 24 forks source link

Can no longer 'put' in certain sagas [3.0.0] #44

Closed stratospark closed 8 years ago

stratospark commented 8 years ago

After updating to 3.0.0 (which I've been really looking forward to btw!), some of my sagas are no longer working. It seems to be that the put commands are not sending actions to the redux store. I can replicate this with a trival example. The BLAHBLAH action is visible in devtools in version 2.1.7, but not so in 3.0.0. However, there are some uses of put that still work, and I'm not sure why.

Is this related to this change in redux-saga 0.10.5? https://github.com/yelouafi/redux-saga/releases/tag/v0.10.5

export function* saga() {
  console.log('start Customers saga!!');
  yield put({type: 'BLAHBLAH'});
  yield* takeEvery('Accounts_SubmitQuery', handleQuery);
}

export const update = new Updater(init, saga) {
...
}
stratospark commented 8 years ago

If it might matter, I am using redux-router 2.5.1

stratospark commented 8 years ago

The only put calls that work are ones that are yielded in a handler to a takeEvery

For example, any put calls in handleQuery will be dispatched properly and seen in devtools.

yield* takeEvery('Accounts_SubmitQuery', handleQuery);
tomkis commented 8 years ago

Thanks for the report, this obviously must be a bug. Let me investigate.

tomkis commented 8 years ago

Fixed in 3.0.1