Skip to content

Allow for sharing of Transition functions #21

Description

@eonarheim

Bug

As referenced in #20, transition functions can be shared across FSM to be more memory efficient since they don't need a reference to their parent FSM.

Proposed fix

Allow for transition functions to be set either in the constructor of the fsm or as a property.

var fsm = new typestate.FiniteStateMachine<States>(State.StartState, [...transistionFunctions]);

// or

var fsm = new typestate.FinitStateMachine<States>(State.StartState);
fsm.functions = [...transitionFunctions];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions