RxStateMachine<STATE, EVENT, SIDE_EFFECT>.create constructor

RxStateMachine<STATE, EVENT, SIDE_EFFECT>.create(
  1. BuildGraph<STATE, EVENT, SIDE_EFFECT> buildGraph
)

Creates a state machine from the graph described in buildGraph.

The graph must define an initial state via GraphBuilder.initialState.

Implementation

factory RxStateMachine.create(BuildGraph<STATE, EVENT, SIDE_EFFECT> buildGraph) {
  final graphBuilder = GraphBuilder<STATE, EVENT, SIDE_EFFECT>();
  buildGraph(graphBuilder);
  return RxStateMachine._(graphBuilder.build());
}