15 lines
242 B
JavaScript
15 lines
242 B
JavaScript
|
import { Machine } from 'xstate'
|
||
|
|
||
|
export const toggleMachine = Machine({
|
||
|
id: 'toggle',
|
||
|
initial: 'inactive',
|
||
|
states: {
|
||
|
inactive: {
|
||
|
on: { TOGGLE: 'active' },
|
||
|
},
|
||
|
active: {
|
||
|
on: { TOGGLE: 'inactive' },
|
||
|
},
|
||
|
},
|
||
|
})
|