We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Did we miss a trick with promise chains? Should we be able to support an operation inside a .then callback?
operation
We can currently do this:
each( $.items, post(`patient/${$.data.id}`, $.data).then(state => { state.completed.push(state.data); return state; }) );
But surely it would be cool to support this?
each( $.items, get(`patient/${$.data.id}`) .then(post(`patient/${$.data.id}`, $.data)) .then((state => { console.log('done!') return state }) )
What I'm saying is that inside then() we should be able to write an operation, without a ()(state) wrapper.
then()
()(state)
Either compiler code, or some magic in promises (perhaps even a custom promise library), would have to "unwrap" the operation.
Something like this maybe?
each( $.items, get(`patient/${$.data.id}`) .then((state) => post(`patient/state{state.data.id}`, state.data)(state)) .then((state => { console.log('done!') return state }) )
But my feeling is:
.then()
.then(get())
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Did we miss a trick with promise chains? Should we be able to support an
operation
inside a .then callback?We can currently do this:
But surely it would be cool to support this?
What I'm saying is that inside
then()
we should be able to write an operation, without a()(state)
wrapper.Either compiler code, or some magic in promises (perhaps even a custom promise library), would have to "unwrap" the operation.
Something like this maybe?
But my feeling is:
.then()
is called with state.then(get())
will pass a function into .then(), which will be lazily executed.then()
to recognise that an Operation has been passed in, and handle it appropriately? I should have all the information it needs.The text was updated successfully, but these errors were encountered: