Skip to content

Instantly share code, notes, and snippets.

@guilherme-teodoro
Created April 15, 2021 17:42
Show Gist options
  • Select an option

  • Save guilherme-teodoro/b75f43ab2bc1fc42b5041ea45f38a7ba to your computer and use it in GitHub Desktop.

Select an option

Save guilherme-teodoro/b75f43ab2bc1fc42b5041ea45f38a7ba to your computer and use it in GitHub Desktop.

Revisions

  1. guilherme-teodoro created this gist Apr 15, 2021.
    22 changes: 22 additions & 0 deletions machine.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@


    const machine = Machine({
    initial: 'verde',
    states: {
    verde: {
    on: {
    PROXIMO: 'amarelo'
    }
    },
    amarelo: {
    on: {
    PROXIMO: 'vermelho'
    }
    },
    vermelho: {
    on: {
    RESETAR: 'verde'
    }
    }
    }
    })