Last active
June 29, 2020 07:59
-
-
Save awchjimmy/cad1b2ba1c7a25319ac482adabe8e0a0 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const fetchMachine = Machine({ | |
id: 'fetch', | |
initial: 'idle', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
idle: { | |
on: { | |
聽課: '查看課程列表', | |
查成績: '成績單', | |
註冊: '申請註冊' | |
} | |
}, | |
查看課程列表: { | |
on: { | |
選擇課程: '查看第幾堂', | |
返回: "idle" | |
} | |
}, | |
查看第幾堂: { | |
on: { | |
選擇堂數: "開始播放", | |
返回: "查看課程列表" | |
} | |
}, | |
開始播放: { | |
on: { | |
返回: "查看第幾堂" | |
} | |
}, | |
成績單: { | |
on: { | |
返回: "idle" | |
} | |
}, | |
申請註冊: { | |
on: { | |
返回: "idle" | |
} | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment