Skip to content

Instantly share code, notes, and snippets.

View martypenner's full-sized avatar
😎
Building cool things

Marty Penner martypenner

😎
Building cool things
View GitHub Profile
@martypenner
martypenner / machine.js
Last active July 22, 2019 23:30
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine(
{
id: 'debouncedFetchLatest',
initial: 'idle',
states: {
idle: {},
success: {},
failure: {
initial: 'other',
states: {
@martypenner
martypenner / keybase.md
Created July 24, 2019 16:23
keybase.md

Keybase proof

I hereby claim:

  • I am martypenner on github.
  • I am martypenner (https://keybase.io/martypenner) on keybase.
  • I have a public key ASC1bDVufJRiPju-9mhTQPjr7RU2UdEFexr6Da8bE_cFnwo

To claim this, I am signing this object:

@martypenner
martypenner / machine.js
Created September 4, 2019 21:21
Generated by XState Viz: https://xstate.js.org/viz
const passcodeMachine = Machine({
id: 'passcode',
initial: 'hidden',
states: {
revealed: {
on: {
HIDE: 'hidden'
}
},
hidden: {
@martypenner
martypenner / SketchSystems.spec
Last active November 21, 2019 20:11
Initializing*
Initializing*
Authenticating*
authenticated -> Authorizing
not authenticated -> Not authenticated
Authorizing
authorized -> Fetching initial data
not authorized -> Not authorized
Fetching initial data
@martypenner
martypenner / machine.js
Last active November 28, 2019 16:18
Generated by XState Viz: https://xstate.js.org/viz
const dashboardMachine = Machine(
{
id: 'dashboard',
context: {
organizations: [],
currentOrganization: null,
currentPeriod: null,
reservations: []
},
states: {
@martypenner
martypenner / machine.js
Created November 29, 2019 21:01
Generated by XState Viz: https://xstate.js.org/viz
const processItem = ({ subEvents: appliesToSubEvents, fromDate, toDate, ...item }) => ({
...item,
appliesToSubEvents: appliesToSubEvents || [],
fromDate: fromDate == null || (typeof fromDate === 'string' && fromDate.trim() === '') ? null : moment(fromDate),
toDate: toDate == null || (typeof toDate === 'string' && toDate.trim() === '') ? null : moment(toDate),
});
const lineItemsMachine = Machine(
{
strict: true,
@martypenner
martypenner / machine.js
Last active December 3, 2019 20:55
Generated by XState Viz: https://xstate.js.org/viz
const taxSettingsMachine = Machine(
{
id: 'taxSettings',
type: 'parallel',
context: {
eventInfo: {
country: '',
status: null,
},
isMarketplaceState: false,
@martypenner
martypenner / machine.js
Created December 4, 2019 20:50
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'switcherList',
initial: 'offscreen',
states: {
offscreen: {
on: {
OPENED: 'opening'
}
},
onscreen: {
@martypenner
martypenner / machine.js
Last active March 19, 2020 21:22
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'backoffFetch',
context: {
status: 'green',
retryCount: 0,
},
initial: 'fetching',
states: {
waiting: {
initial: 'success',
@martypenner
martypenner / machine.js
Last active March 19, 2020 21:27
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'backoffFetch',
context: {
status: 'green',
retryCount: 0,
},
type: 'parallel',
states: {
health: {
initial: 'healthy',