Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jun 2, 2021
1 parent bdd424b commit 2de3ec3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .changeset/strange-poets-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'xstate': patch
---

The `state.meta` value is now calculated directly from `state.configuration`. This is most useful when starting a service from a persisted state:

```ts
const machine = createMachine({
id: 'test',
initial: 'first',
states: {
first: {
meta: {
name: 'first state'
}
},
second: {
meta: {
name: 'second state'
}
}
}
});

const service = interpret(machine);

service.start('second'); // `meta` will be computed

// the state will have
// meta: {
// 'test.second': {
// name: 'second state'
// }
// }
});
```

0 comments on commit 2de3ec3

Please sign in to comment.