Commit 5c5dcd30 authored by Thomas Randolph's avatar Thomas Randolph

Extract definition properties as part of the method signature

parent d7038bef
...@@ -50,9 +50,8 @@ export function transition(definition, current, event) { ...@@ -50,9 +50,8 @@ export function transition(definition, current, event) {
return definition?.states?.[current]?.on[event] || current; return definition?.states?.[current]?.on[event] || current;
} }
function startMachine(definition) { function startMachine({ states, initial } = {}) {
const { states } = definition; let current = initial;
let current = definition.initial;
return { return {
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment