Skip to content

Commit e4d75d9

Browse files
invoke.mdx: more legible onDone example
Co-authored-by: David Khourshid <[email protected]>
1 parent f0bffaf commit e4d75d9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/invoke.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,20 +243,24 @@ Don't get the `onDone` property on a state confused with `invoke.onDone` - they
243243
- The `onDone` property on a [state](states.mdx) node refers to the compound state node reaching a [final state](final-states.mdx).
244244
- The `invoke.onDone` property refers to the invocation (`invoke.src`) being done.
245245

246-
```js {5,13}
246+
```js
247247
// ...
248248
loading: {
249249
invoke: {
250250
src: someSrc,
251-
onDone: {/* ... */} // refers to `someSrc` being done
251+
// refers to `someSrc` being done
252+
// highlight-next-line
253+
onDone: {/* ... */}
252254
},
253255
initial: 'loadFoo',
254256
states: {
255257
loadFoo: {/* ... */},
256258
loadBar: {/* ... */},
257259
loadingComplete: { type: 'final' }
258260
},
259-
onDone: 'loaded' // refers to 'loading.loadingComplete' being reached
261+
// refers to 'loading.loadingComplete' being reached
262+
// highlight-next-line
263+
onDone: { target: 'loaded' }
260264
}
261265
// ...
262266
```

0 commit comments

Comments
 (0)