state enabled {
toggle => disabled
}
initial state disabled {
toggle => enabled
}
import { createMachine } from 'xstate';
export default function() {
return createMachine({
initial: 'disabled',
states: {
enabled: {
on: {
toggle: 'disabled'
}
},
disabled: {
on: {
toggle: 'enabled'
}
}
}
});
}
See the install page for detailed instructions on the various ways you can use Lucy, such as with popular JavaScript build tools.
To use the command-line compiler install with:
curl -sSf https://lucylang.org/install.sh | bash