How can I know when a redux-saga function has completed in the calling code -


react, redux, redux-saga

i dispatch action, create_requested store. redux-saga runs, , makes async call server. after saga completes, i.e. blocks next create_requested want execute additional code, container/component first create_requested initiated.

// pseudo code class cmp extends react.component {    oncreateclick(id) {      const record = {id, name: 'alabala'}      // missing .then() part      this.props.dispatch({type: 'create_requested', record}).then(created => {         console.log(created)      }    } } 

is there way that? how? if not, how supposed design task?

one approach pass (resolve, reject) options along action, , make saga call them on succcess/failure. seems ok.

https://github.com/yelouafi/redux-saga/issues/161


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -