yieldmachine
yieldmachine copied to clipboard
Allow states with dynamic elements, e.g. a router
const songID = Symbol();
yield path(['song', songID]);
Could allow State to be represented a URL or JSON tuple/object. This could turn into support for serialising and deserialising the current state.
machine.current; // { song: 123 }
musicURLFromState(machine.currentURL); // "/song/123"
machine.jump({ song: 456 });
machine.current; // { song: 456 }
musicURLFromState(machine.currentURL); // "/song/456"
machine.jump(musicStateFromURL("/song/789"));
machine.current; // { song: 789 }