0.3.0
This version changes the syntax of all create*Activity
functions. The first argument is the step type, the second argument is the configuration.
// Old syntax
const fooActivity = createAtomActivity<FooStep, MyGlobalState, FooStateState>({
stepType: 'foo',
init: /* ... */,
handler: /* ... */,
})
// New syntax
const fooActivity = createAtomActivity<FooStep, MyGlobalState, FooStateState>('foo', {
init: /* ... */,
handler: /* ... */,
})
Additionally this version introduces the createAtomActivityFromHandler
function. It allows to create an activity by very short syntax. This function creates an activity without the activity state.
const fooActivity = createAtomActivityFromHandler<FooStep, MyGlobalState>('foo', async (step, globalState) => {
// handler
});