Skip to content

Refactor: 1) Separate TransitionFn & OutputFn #45

@juancarrey

Description

@juancarrey

Separate into TransitionFn & OutputFn

DFSM has noop OutputFn

Handle returns still StateMachine

const void = createVoidMachine('A', 
  [
    ['A', '1', 'B'],
    ['A', '2', 'B'],
    ['B', '1', 'A'],
    ['B', '2', 'A'],
  ]
);

const mealy = createMealy('A', 
  [
    ['A', '1', 'B', '0'],
    ['A', '2', 'B', '1'],
    ['B', '1', 'A', '1'],
    ['B', '2', 'A', '2'],
  ]
);

const moore = createMoore('A', 
  [
    ['A', '1', 'B'],
    ['A', '2', 'B'],
    ['B', '1', 'A'],
    ['B', '2', 'A'],
  ],
  { 'A': 1, 'B': 0 }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRefactoring code and making it work better

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions