Insert a value that is computed later, at the moment when it is needed
const output = {
results: loadRecords(),
meta: deferred(async () => {
/* generate metadata */
})
};
cb
- <AsyncFunction>
Callback that produces the eventual value
deferred
simply return an object with the callback as its onJSON
handler.