Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've just released support in the runtime to treat every operation as a Promise.
See OpenFn/kit#722 for all the gory details.
The tl;dr on this is:
fn().catch()
.then()
should remove the need for 95% of callbacks in adaptor codeeach($.data, fn().then())
This is a really big deal and needs good documentation.
The tension here is that I want to communicate the change to users who know openfn, but to new users this promises and callbacks thing is an edge case really.
In the future, most of the existing Callbacks section of the docs will be removed, and we'll just have this Promises stuff and maybe a section explaining
fn()
(because a lot of callbacks in existing job code should now migrate to using an fn block)