[XState] History state
Posted answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[XState] History state相关的知识,希望对你有一定的参考价值。
const displayMachine = createMachine({ initial: "hidden", states: { hidden: { on: { TURN_ON: "visible.hist", }, }, visible: { initial: "light", states: { light: { on: { SWITCH: { target: "dark", }, }, }, dark: { on: { SWITCH: { target: "light", }, }, }, hist: { type: "history", }, }, on: { TURN_OFF: "hidden", }, }, }, });
以上是关于[XState] History state的主要内容,如果未能解决你的问题,请参考以下文章
[XState] Track Infinite States with with XState Context
[XState] Invoking a Promise for Asynchronous State Transitions in XState