I am using redux-saga
. In the code yield* ReduxSaga.takeEvery('MY_ACTION', updatePorts);
how can I access the action
to get its fields.
For example I have an action creator:
function status(){
type: 'MY_ACTION',
status: true
}
How can I access action.status
from my saga? Or do I have to access data only via getState()
and select?
const actionCreator=()=>({
type: 'MY_ACTION',
status:true
})
function* updatePorts(action) {
console.log(action.status)
}
function* watchUpdatePorts() {
yield* takeEvery('MY_ACTION', updatePorts)
}
https://github.com/redux-saga/redux-saga/tree/master/docs/api#takeeverypattern-saga-args