Skip to content

Instantly share code, notes, and snippets.

function notifyActionName(context, event) {
window.alert(`Triggered action \`${event.type}\``)
}
const fetchMachine = Machine( {
initial: 'idle',
id: 'quickstart-button-step-7',
states: {
idle: {
@LevelbossMike
LevelbossMike / machine.js
Last active March 25, 2020 17:02
Generated by XState Viz: https://xstate.js.org/viz
function notifyActionName(context, event) {
window.alert(`Triggered action \`${event.type}\``)
}
const fetchMachine = Machine( {
id: 'quickstart-button-step-8',
type: 'parallel',
context: {
isEnabled: true
},
function notifyActionName(context, event) {
window.alert(`Triggered action \`${event.type}\``)
}
const fetchMachine = Machine( {
id: 'quickstart-button-step-5',
initial: 'idle',
states: {
idle: {
function notifyActionName(context, event) {
window.alert(`Triggered action \`${event.type}\``)
}
const fetchMachine = Machine( {
id: 'quickstart-button-step-4',
initial: 'idle',
states: {
idle: {
function notifyActionName(context, event) {
window.alert(`Triggered action \`${event.type}\``)
}
const fetchMachine = Machine( {
id: 'quickstart-button-step-4',
initial: 'idle',
states: {
idle: {
const fetchMachine = Machine( {
id: 'quickstart-button-step-3',
initial: 'idle',
states: {
idle: {
on: {
SUBMIT: 'busy',
},
},
busy: {
const fetchMachine = Machine({
initial: 'idle',
states: {
idle: {
on: {
SUBMIT: 'busy'
}
},
busy: {}
}
@LevelbossMike
LevelbossMike / machine.js
Last active March 25, 2020 16:15
Generated by XState Viz: https://xstate.js.org/viz
const buttonMachine = Machine({
initial: 'idle',
states: {
idle: {
},
busy: {}
}
});
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@LevelbossMike
LevelbossMike / machine.js
Created February 20, 2020 18:44
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions