Closed taion closed 8 years ago
Regarding: https://github.com/acdlite/redux-promise/blob/v0.4.0/src/index.js#L15-L20
I was working through a problem that looked like it might have been handled by this, but am having this issue - in pseudocode that corresponds to no specific Flux framework, I'm doing something like:
updateFoo(id) { FooUtils.updateFoo(id).then( result => this.dispatch(UPDATE_FOO_SUCCESS, {id, result}), error => this.dispatch(UPDATE_FOO_ERROR, {id, error}) ); }
In principle with something like the promise middleware, I ought to be able to do something like:
updateFoo(id) { this.dispatch(UPDATE_FOO, FooUtils.updateFoo(id)); }
but that's not quite sufficient if I want to pass through the id field - it might have to be something like
id
updateFoo(id) { this.dispatch(UPDATE_FOO, FooUtils.updateFoo(id).then( result => {id, result}, error => throw {id, error} ); }
which seems a bit verbose.
Sorry if this is a bit rambly - am I just missing something obvious here?
I don't remember what I was trying to get at here any more.
Regarding: https://github.com/acdlite/redux-promise/blob/v0.4.0/src/index.js#L15-L20
I was working through a problem that looked like it might have been handled by this, but am having this issue - in pseudocode that corresponds to no specific Flux framework, I'm doing something like:
In principle with something like the promise middleware, I ought to be able to do something like:
but that's not quite sufficient if I want to pass through the
id
field - it might have to be something likewhich seems a bit verbose.
Sorry if this is a bit rambly - am I just missing something obvious here?