Skip to content
Compare
Choose a tag to compare
@StarpTech StarpTech released this 11 Mar 18:39
· 370 commits to master since this release

Breaking changes

  • Use of callback-style with act(...) won't return a promise anymore rather undefined
  • Use of promise-style with act(...) will return to a fulfilled promise a context object with two properties data and context. On a rejection, only the error is returned.
    • data message response
    • context hemera instance with the right meta$, context$ and trace$ informations.

Migration Guide

Don't mix callback and promise style and work in case of promise with the result object

Before

const result = await hemera.act({
  topic: "math",
  cmd: "add"
}, async function (err, resp) {
	// code ...
})

After with promise

const result = await hemera.act({
  topic: "math",
  cmd: "add"
})
// code ...
result.data
result.context

After with callback

hemera.act({
  topic: "math",
  cmd: "add"
}, function (err, resp) {
	// code ...
})