Skip to content

Version 3.1.0

Compare
Choose a tag to compare
@afitiskin afitiskin released this 04 Oct 15:53
· 19 commits to master since this release
  • Add ability to pass payloadCreator and metaCreator as objects to define specific payload and meta creators for each routine action. This changes are fully backward compatible.

    const myRoutine = createRoutine('SOME/PREFIX', {
      trigger: (payload) => payload * 2,
      request: (payload) => payload * 3,
      success: (payload) => payload * 4,
      failure: (payload) => payload * 5,
      fulfill: (payload) => payload * 6,
    }, {
      trigger: () => { info: 'trigger action meta' },
      request: () => { info: 'request action meta' },
      success: () => { info: 'success action meta' },
      failure: () => { info: 'failure action meta' },
      fulfill: () => { info: 'fulfill action meta' },
    })