Skip to content

Instantly share code, notes, and snippets.

View robertpenner's full-sized avatar

Robert Penner robertpenner

View GitHub Profile
@robertpenner
robertpenner / machine.js
Last active July 15, 2021 18:11
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'modalMachine',
initial: 'closed',
states: {
closed: {
on: {
OPEN: 'open',
TOGGLE: 'open',
},
},
const context = {
// TODO: separate machines for logged in/logged out
// logged out
email: '',
password: '',
passwordA: '',
passwordB: '',
username: '',
loginError: '',
const EMPTY_SONG = Object.freeze({
id: '',
title: '',
description: '',
thumbnail: '',
});
const context = {
// logged in
player: {
@robertpenner
robertpenner / machine.js
Last active June 23, 2021 16:18
Generated by XState Viz: https://xstate.js.org/viz
const EMPTY_SONG = Object.freeze({
id: '',
title: '',
description: '',
thumbnail: '',
});
const context = {
// logged in
player: {
const EMPTY_SONG = Object.freeze({
id: '',
title: '',
description: '',
thumbnail: '',
});
const context = {
// TODO: separate machines for logged in/logged out
// logged out
const context = {
email: '',
password: '',
passwordA: '',
passwordB: '',
username: '',
loginError: '',
recoveryEmailError: '',
};
@robertpenner
robertpenner / machine.js
Last active June 16, 2021 03:17
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'Audacy App',
context: {
email: '',
password: '',
loginError: '',
recoveryEmailError: '',
},
initial: 'logged out',
const machine = Machine( {
id: 'Audacy',
type: 'parallel',
states: {
'core page': {
id: 'core page',
meta: { description: '4 pages with dedicated buttons' },
on: {
TAP_FOR_YOU: '.For you',
TAP_MUSIC: '.Music',
const machine = Machine({
id: 'Audacy',
type: 'parallel',
states: {
'core page': {
id: 'core page',
meta: { description: '4 pages with dedicated buttons' },
on: {
TAP_FOR_YOU: '.For you',
TAP_MUSIC: '.Music',
const machine = Machine({
id: 'Audacy - App Map',
type: 'parallel',
states: {
'core page': {
id: 'core page',
meta: { description: '4 pages with dedicated buttons' },
on: {
TAP_FOR_YOU: '.For you',
TAP_MUSIC: '.Music',