Upgrade to Pro — share decks privately, control downloads, hide ads and more …

複雑なステート管理をらくにするステートマシンを使ったアプローチ

 複雑なステート管理をらくにするステートマシンを使ったアプローチ

モバイルアプリのステート管理に役立つステートマシンの紹介をします。

Tomoki Yamashita

December 22, 2022
Tweet

More Decks by Tomoki Yamashita

Other Decks in Technology

Transcript

  1. Web

  2. Event.LoginPageShown Event.LoginPageShown Event.LoginScriptExecuted Event.TopPageShown Event.LoadingObserverLaunched Event.LoginPageShown Event.CheckInButtonClicked Event.CheckOutButtonClicked CheckInScriptExecuted Event.ClockShown

    Event.ErrorShown Event.ClockShown State.Init State.WaitForLogin State.WaitForAuth State.WaitForLoadingObserverLaunch State.WaitForCheckIn State.WaitForCheckInScriptExecuted State.CheckInLoading State.ErrorShown
  3. StateMachine.create { initialState(Init) state<Init> { on<LoginPageShown> { transitionTo(WaitForLogin) } }

    state<WaitForLogin> { on<LoginPageShown> { transitionTo(WaitForLogin) } on<LoginScriptExecuted> { transitionTo(WaitForAuth) } } state<WaitForAuth> { on<TopPageShown> { transitionTo(WaitForLoadingObserver on<LoginPageShown> { transitionTo(WaitForLogin) } } state<WaitForLoadingObserverLaunch> { on<LoadingObserverLaunched> { transitionTo(WaitForChec Tinder/StateMachine