Skip to content
Version: xstate@5.0.0

ActorLogic interface​

Signature:

export interface ActorLogic<TSnapshot extends Snapshot<unknown>, TEvent extends EventObject, TInput = unknown, TSystem extends ActorSystem<any> = ActorSystem<any>> 

Properties​

PropertyModifiersTypeDescription
config?unknown(Optional)
getInitialState(actorCtx: ActorContext<TSnapshot, TEvent, TSystem>, input: TInput) => TSnapshot
getPersistedState(state: TSnapshot) => Snapshot<unknown>
restoreState?(persistedState: Snapshot<unknown>, actorCtx: ActorContext<TSnapshot, TEvent>) => TSnapshot(Optional)
start?(state: TSnapshot, actorCtx: ActorContext<TSnapshot, TEvent>) => void(Optional)
transition(state: TSnapshot, message: TEvent, ctx: ActorContext<TSnapshot, TEvent, TSystem>) => TSnapshot