Skip to content

Instantly share code, notes, and snippets.

View AndresRodH's full-sized avatar
🇻🇪
👾

Andres Rodriguez AndresRodH

🇻🇪
👾
View GitHub Profile
@AndresRodH
AndresRodH / breadcrumbs.tsx
Last active November 23, 2021 18:29
react-location breadcrumbs
import {MakeGenerics, Route} from 'react-location'
type LocationGenerics = MakeGenerics<{
Params: {
teamId: string
}
RouteMeta: {
breadcrumb: (params: LocationGenerics['Params']) => React.ReactElement
}
}>
@AndresRodH
AndresRodH / machine.js
Last active November 28, 2020 15:55
Example 4
const doTheThingMachine = Machine({
id: 'do-the-thing',
initial: 'validating',
states: {
validating: {
invoke: {
src: 'validateArgs',
onDone: 'handlingThings',
onError: {
target: 'failure',
@AndresRodH
AndresRodH / machine.js
Last active November 28, 2020 15:44
Example 3
const doTheThingMachine = Machine({
id: 'do-the-thing',
initial: 'validating',
states: {
validating: {
invoke: {
src: 'validateArgs',
onDone: 'handlingThings',
onError: {
target: 'failure',
@AndresRodH
AndresRodH / machine.js
Last active November 28, 2020 15:42
Example 2
const doTheThingMachine = Machine({
id: 'do-the-thing',
initial: 'validating',
states: {
validating: {
invoke: {
src: 'validateArgs',
onDone: 'handlingThings',
onError: {
target: 'failure',
@AndresRodH
AndresRodH / machine.js
Last active November 28, 2020 15:42
Example 1
const doTheThingMachine = Machine({
id: 'do-the-thing',
initial: 'validating',
states: {
validating: {},
handlingThings: {},
success: {
type: 'final',
},
failure: {
@AndresRodH
AndresRodH / machine.js
Last active November 20, 2020 21:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@AndresRodH
AndresRodH / machine.js
Last active October 28, 2020 13:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@AndresRodH
AndresRodH / machine.js
Last active December 15, 2020 13:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@AndresRodH
AndresRodH / machine.js
Last active August 20, 2020 18:18
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@AndresRodH
AndresRodH / machine.js
Last active August 7, 2020 22:16
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions