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) {
return definition?.states?.[current]?.on[event] || current;
}
function startMachine(definition) {
const { states } = definition;
let current = definition.initial;
function startMachine({ states, initial } = {}) {
let current = initial;
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