Skip to content

0.3.0

Compare
Choose a tag to compare
@b4rtaz b4rtaz released this 15 Jul 15:59
· 12 commits to main since this release
8025a9d

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
});