redux saga - yield on a function that returns object which includes a promise -


in saga have function need yield on doesnt return promise directly. function this:

export function requestdownload(url): {     let resolve, reject;     return {         type: request,         url,         promise: new promise(res=>resolve=res, rej=>reject=rej),         resolve,         reject     } } 

i need yield on promise field in return. tried variations of call not able this. cannot modify requestdownload function return promise directly.

is possible of redux-saga helpers?

in summary trying do:

i trying do:

function* mysaga() {     yield call(requestdownload, 'blah_url') } 

how about:

function* mysaga() {     let action = yield call(requestdownload, 'blah_url')     try {         let data = yield action.promise     } catch(err) {         // deal error     } } 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -