Skip to content

Commit c6faa0d

Browse files
committed
Fix example
1 parent 6f19ec2 commit c6faa0d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/actors.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,10 @@ const machine = createMachine({
461461
// ...
462462
states: {
463463
// ...
464-
done: { type: 'final', output: 42 }
464+
done: { type: 'final' }
465+
},
466+
output: {
467+
count: 42
465468
}
466469
});
467470

@@ -475,7 +478,7 @@ const output = await toPromise(actor);
475478
// highlight-end
476479

477480
console.log(output);
478-
// => 42
481+
// => { count: 42 }
479482
```
480483

481484
If the actor is already done, the promise will resolve with the actor's `snapshot.output` immediately. If the actor is already errored, the promise will reject with the actor's `snapshot.error` immediately.

0 commit comments

Comments
 (0)