Slide 60
Slide 60 text
} else {
// Transition to the state that matches the url, and return that
const transitionState = await asyncInterpret(
swagStoreMachine, // machine definition
3_000, // timeout
currentState, // current state
{ type: "Goto", destination: state }, // event to send
);
return json(transitionState, {
headers: {
"Set-Cookie": await
swagStoreMachineCookie.serialize(transitionState),
},
});
}
};
routes/$state/index.ts Loader
Erik Rasmussen – @erikras – May 25, 2022