Skip to content

Instantly share code, notes, and snippets.

View tivac's full-sized avatar
💭
👋🏻🙃

Pat Cavit tivac

💭
👋🏻🙃
View GitHub Profile
@tivac
tivac / machine.js
Created July 8, 2020 21:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tivac
tivac / machine.js
Created May 7, 2020 20:45
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tivac
tivac / machine.js
Last active March 15, 2020 18:51
Generated by XState Viz: https://xstate.js.org/viz
const childMachine = Machine({
initial : "child1",
states : {
child1 : {
on : {
CHILD : "child2",
},
},
@tivac
tivac / machine.js
Created March 11, 2020 16:37
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "delay + state",
type: "parallel",
context : {
fetched : false,
},
on : {
FETCHED : {
@tivac
tivac / machine.js
Last active March 11, 2020 16:30
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "delay + state",
type: "parallel",
states: {
status: {
initial: "intros",
states: {
intros: {
after: {
@tivac
tivac / machine.js
Created February 6, 2020 07:43
Generated by XState Viz: https://xstate.js.org/viz
const menuMachine = Machine({
id : "menu",
initial : "booting",
states : {
booting : {
on : {
// First-time client launches with services
BOOTING_FTUE : "ftue",
@tivac
tivac / machine.js
Created February 6, 2020 00:10
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: "menu",
initial: "initialize",
states: {
initialize: {
on: {
CONNECTION: [{
cond: (ctx, { lan } = false) => lan,
actions: assign({
lan: true,
@tivac
tivac / machine.js
Created February 5, 2020 23:26
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: "menu",
initial: "initialize",
states: {
initialize : {
on : {
CONNECTION : [{
cond : (ctx, { lan }) => lan,
target : "lan",
}, {
@tivac
tivac / machine.js
Created December 3, 2019 19:51
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
on: {
"": {
@tivac
tivac / machine.js
Created November 8, 2019 06:25
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions