Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update meta docs for v5 and provide a little more description #416

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/finite-states.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Read more about [tags](tags.mdx).

## Meta

Meta data is static data that describes relevant properties of a state node. You can specify meta data on the `.meta` property of any state node. This can be useful for displaying information about a state node in a UI, or for generating documentation.
Meta data is static data that describes relevant properties of a state node. You can specify meta data on the `.meta` property of any state node. This can be useful for displaying information about a state node in a UI, or for generating documentation. You may access the state node's `meta` properties at runtime with the following: `yourActor.getSnapshot().getMeta()`. Note only "top level" `meta` and the current state's `meta` fields will be returned in `getMeta()`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Meta data is static data that describes relevant properties of a state node. You can specify meta data on the `.meta` property of any state node. This can be useful for displaying information about a state node in a UI, or for generating documentation. You may access the state node's `meta` properties at runtime with the following: `yourActor.getSnapshot().getMeta()`. Note only "top level" `meta` and the current state's `meta` fields will be returned in `getMeta()`.
Meta data is static data that describes relevant properties of a state node. You can specify meta data on the `.meta` property of any state node. This can be useful for displaying information about a state node in a UI, or for generating documentation. You may access the state node's `meta` properties at runtime with the following: `yourActor.getSnapshot().getMeta()`. Note that only the `meta` data for the active state nodes (including the root state node) will be returned in `getMeta()`.


The `state.meta` property collects the `.meta` data from all active state nodes and places them in an object with the state node’s ID as the key and the `.meta` data as the value:

Expand Down Expand Up @@ -197,7 +197,7 @@ const feedbackMachine = createMachine({

const feedbackActor = createActor(feedbackMachine).start();

console.log(feedbackActor.getSnapshot().meta);
console.log(feedbackActor.getSnapshot().getMeta());
// logs the object:
// {
// feedback: {
Expand Down