Closed josephjclark closed 1 month ago
@ritazagoni @mtuchi can you pls review and provide feedback here?
I've just updated the docs to be a bit sharper. I've also moved it all down the page.
The docs should be self explanatory. Eventually this section should replace the Callbacks
bit entirely.
We've just released support in the runtime to treat every operation as a Promise.
See https://github.com/OpenFn/kit/pull/722 for all the gory details.
The tl;dr on this is:
1) You can now do
fn().catch()
2).then()
should remove the need for 95% of callbacks in adaptor code 3) You should start doingeach($.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)