Dva: Is it possible to call an effect from another effect?

Created on 2 May 2017  ·  4Comments  ·  Source: dvajs/dva

Or at least fire an action from within an affect?

Most helpful comment

yield put({ type: 'anotherModel/effectA', payload: 111 })
yield put({ type: 'effectInSameModel', payload: 222 })

All 4 comments

yield put(action) ?

It's not working for me. To make sure, I am trying to call an effect from another effect. No reducers involved.

yield put({ type: 'anotherModel/effectA', payload: 111 })
yield put({ type: 'effectInSameModel', payload: 222 })

Nm I forgot to yield.

For some reason this is not working for me. Nothing happens.
If I take the dispatch function and call it then it works...

Was this page helpful?
0 / 5 - 0 ratings