Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jan 8, 2020
1 parent 31d1598 commit c8db035
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lazy-windows-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate': patch
---

The `escalate()` action can now take in an expression, which will be evaluated against the `context`, `event`, and `meta` to return the error data.
3 changes: 2 additions & 1 deletion packages/core/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ export function forwardTo<TContext, TEvent extends EventObject>(
/**
* Escalates an error by sending it as an event to this machine's parent.
*
* @param errorData The error data to send.
* @param errorData The error data to send, or the expression function that
* takes in the `context`, `event`, and `meta`, and returns the error data to send.
* @param options Options to pass into the send action creator.
*/
export function escalate<
Expand Down

0 comments on commit c8db035

Please sign in to comment.