Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Matchina
GitHub

Lifecycle

All machine types implement the same genericEventLifecycle and hook methods for consistency. This allows you to use the same patterns across different machine types, whether you’re using aFactoryMachine, aStateMachine, or aStoreMachine.

When you callmachine.send(type, ...params), the following flow occurs:

Called with an event type and parameters.

Determines the target state for the event.

Checks if the transition is allowed.

  • Iffalse, exit early.

First opportunity to process the event.

  • If returnsundefined, exit early.

Called before the state change.

  • If returnsundefined, exit early.

Updates the internal state.

Runs side effects.

Called when leaving the previous state.

Called when entering the new state.

Notifies subscribers.

Final hook after transition completes.

  • Ifguard returnsfalse, orhandle/before returnundefined, the transition stops and no further steps run.

[8]ページ先頭

©2009-2025 Movatter.jp