Skip to content

Instantly share code, notes, and snippets.

View ishabo's full-sized avatar

Joshua ishabo

  • YodaTek LTD
  • London
View GitHub Profile
@ishabo
ishabo / machine.js
Created October 11, 2019 16:30
Generated by XState Viz: https://xstate.js.org/viz
const todoMachine = Machine({
id: "todo",
initial: "reading",
context: {
id: undefined,
title: "",
prevTitle: ""
},
on: {
TOGGLE_COMPLETE: {
@ishabo
ishabo / machine.js
Last active October 10, 2019 18:15
Generated by XState Viz: https://xstate.js.org/viz
const fetchProjections = amount =>
new Promise((resolve, reject) => {
console.log('Fetching ', amount);
const projections = {monthlyEstimate: 120, maxAge: 80};
resolve(projections);
});
const validateInput = (input, mimimum) =>
new Promise((resolve, reject) => {
if (input >= mimimum) {
@ishabo
ishabo / machine.js
Created October 10, 2019 17:39
Generated by XState Viz: https://xstate.js.org/viz
const fetchProjections = amount =>
new Promise((resolve, reject) => {
console.log('Fetching ', amount);
const projections = {monthlyEstimate: 120, maxAge: 80};
resolve(projections);
});
const validateInput = (input, mimimum) =>
new Promise((resolve, reject) => {
if (input >= mimimum) {
@ishabo
ishabo / machine.js
Last active October 10, 2019 17:59
Generated by XState Viz: https://xstate.js.org/viz
const fetchProjections = amount =>
new Promise((resolve, reject) => {
console.log('Fetching ', amount);
const projections = {monthlyEstimate: 120, maxAge: 80};
resolve(projections);
});
const validateInput = (input, mimimum) =>
new Promise((resolve, reject) => {
if (input >= mimimum) {