@nodescript/stdlib
Version:
Standard Node Definitions
30 lines (29 loc) • 733 B
JavaScript
export const module = {
version: '1.0.3',
moduleName: 'Flow / Then',
description: `
Runs the specified step, discards its result and returns a "then" value.
Useful when joining mutliple asynchronous processes together.
`,
params: {
step: {
deferred: true,
schema: { type: 'any' },
},
then: {
deferred: true,
schema: { type: 'any' },
},
},
result: {
async: true,
schema: {
type: 'array',
items: { type: 'any' },
},
}
};
export const compute = async (params, ctx) => {
await ctx.resolveDeferred(params.step);
return await ctx.resolveDeferred(params.then);
};