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

[v5] Restrict context to object #2294

Merged
merged 8 commits into from
Jun 13, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update packages/xstate-graph/src/graph.ts
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
davidkpiano and Andarist authored Jun 13, 2021
commit 7b0c44ebaffae864e7c16813d7402b2cf13a30c9
2 changes: 1 addition & 1 deletion packages/xstate-graph/src/graph.ts
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ export function serializeState<TContext extends MachineContext>(
state: State<TContext, any>
): string {
const { value, context } = state;
return context === undefined || Object.keys(context).length === 0
return Object.keys(context).length === 0
? JSON.stringify(value)
: JSON.stringify(value) + ' | ' + JSON.stringify(context);
}