Skip to content

Instantly share code, notes, and snippets.

View epan's full-sized avatar

Eric Pan epan

View GitHub Profile
@epan
epan / machine.js
Last active June 18, 2020 18:27
Generated by XState Viz: https://xstate.js.org/viz
// v6.1
// assumes consumer prompt in every possible case
// no network requests
// no saving local data
// no saving network response
// actions not optimized
const withConsumerPromptMachine = Machine({
id: 'withConsumerPromptAsDefault',
initial: 'closed',
@epan
epan / machine.js
Created June 18, 2020 17:28
Generated by XState Viz: https://xstate.js.org/viz
// V3.2
// Transitions, assuming no cancel, no fails, no loading (V3.2)
const simplifiedExistingMachine = Machine({
id: 'simplifiedExisting',
initial: 'closed',
context: {},
states: {
closed: {
on: {
@epan
epan / machine.js
Created June 18, 2020 05:22
Generated by XState Viz: https://xstate.js.org/viz
// V3.2
// Transitions, assuming no cancel, no fails, no loading (V3.2)
const simplifiedExistingMachine = Machine({
id: 'simplifiedExisting',
initial: 'closed',
context: {},
states: {
closed: {
on: {
@epan
epan / machine.js
Last active June 18, 2020 16:52
Generated by XState Viz: https://xstate.js.org/viz
// V3.1
// Transitions, assuming no cancel, no fails, no loading (V3.1)
const simplifiedExistingMachine = Machine({
id: 'simplifiedExisting',
initial: 'closed',
context: {},
states: {
closed: {
on: {
@epan
epan / machine.js
Last active June 18, 2020 04:52
Generated by XState Viz: https://xstate.js.org/viz
// v5
// existing behavior
// no network requests
// no saving local data
// no saving network response
// actions not optimized
const groupedStateMachineCurrentBehavior = Machine({
id: 'addressManager',
context: {
@epan
epan / machine.js
Last active June 18, 2020 17:26
Generated by XState Viz: https://xstate.js.org/viz
// V4
// Transitions, assuming hasPrompts, no cancel, no fails, no loading (V4)
const simplifiedPromptsMachine = Machine({
id: 'simplifiedPrompts',
initial: 'closed',
states: {
closed: {
on: {
OPEN: 'addressList'
}
@epan
epan / machine.js
Created June 13, 2020 05:09
Generated by XState Viz: https://xstate.js.org/viz
// V3
// Transitions, assuming no cancel, no fails, no loading (V3)
const simplifiedExistingMachine = Machine({
id: 'simplifiedExisting',
initial: 'closed',
context: {},
states: {
closed: {
on: {
@epan
epan / machine.js
Created June 12, 2020 06:32
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@epan
epan / machine.js
Last active June 18, 2020 17:24
Generated by XState Viz: https://xstate.js.org/viz
// V1.1 basic with new vs existing address flow states
const addressManagerMachine = Machine({
id: 'addressManager',
initial: 'closed',
states: {
closed: {
on: {
CLICK: 'addressList'
}
},
@epan
epan / blockstack.txt
Created November 16, 2017 17:26
blockstack verification
Verifying my Blockstack ID is secured with the address 17ut2nUHmUwKcReoSembaVUixp7mvhBMkA https://explorer.blockstack.org/address/17ut2nUHmUwKcReoSembaVUixp7mvhBMkA