Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jun 23, 2021
1 parent e560b48 commit 5f790ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .changeset/itchy-cameras-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'xstate': patch
---

The typing for `InvokeCallback` have been improved for better event constraints when using the `sendBack` parameter of invoked callbacks:

```ts
invoke: () => (sendBack, receive) => {
// Will now be constrained to events that the parent machine can receive
sendBack({ type: 'SOME_EVENT' });
};
```
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export interface InvokeMeta {
*/
export type InvokeCreator<
TContext,
TEvent extends EventObject = AnyEventObject,
TEvent extends EventObject,
TFinalContext = any
> = (
context: TContext,
Expand Down

0 comments on commit 5f790ba

Please sign in to comment.