React, redux, redux saga
I sent the action, let's say CREATE_REQUESTEDto the store. The Redux saga starts and issues an asynchronous call to the server. After the completion of the saga, i.e. Blocks for the next CREATE_REQUESTED, I want to execute additional code from the container / component from which the first was initiated CREATE_REQUESTED.
class Cmp extends React.component {
onCreateClick(id) {
const record = {id, name: 'alabala'}
this.props.dispatch({type: 'CREATE_REQUESTED', record}).then(created => {
console.log(created)
}
}
}
Is there any way to do this? How? If not, how should I design this task?
source
share