This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filterSubStates = filterName => ({ | |
initial: "disabled", | |
states: { | |
disabled: { | |
on: { [`ENABLE_${filterName}`]: "enabled" } | |
}, | |
enabled: { | |
initial: "asc", | |
on: { | |
[`DISABLE_${filterName}`]: "disabled" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filterSubStates = filterName => ({ | |
initial: "disabled", | |
states: { | |
disabled: { | |
on: { [`ENABLE_${filterName}`]: "enabled" } | |
}, | |
enabled: { | |
initial: "asc", | |
on: { [`DISABLE_${filterName}`]: "disabled" }, | |
states: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isLoading = true // Great, we know we know something is loading | |
const isLoading = false // We only know we're not loading, ANYTHING ELSE IS POSSIBLE | |
// In symbolic logic, this is referred to as a _modus tollens_ | |
// the negation of an assertion only tells us that _that_ particular thing | |
// in the universe is negated, it conveys _no_ logical information about anything else | |
// Ex. If I have a Mtn Dew in front of me, I will drink it. | |
// I do _not_ have a Mtn Dew in front of me, therefore I can't assert anything | |
// about anything I am doing other than _not_ drinking a Mtn Dew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const masterView = Machine({ | |
id: 'masterView', | |
initial: 'idle', | |
context: { | |
assetsSelected: 0 | |
}, | |
states: { | |
idle: {}, | |
selection: { | |
on: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assetManagerViewMachine = Machine( | |
{ | |
id: "assetManagerView", | |
initial: "closed", | |
context: { | |
assetsSelected: 0 | |
}, | |
states: { | |
closed: { | |
on: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assetManagerViewMachine = Machine({ | |
id: 'assetManagerView', | |
initial: 'closed', | |
states: { | |
closed: { | |
on: { | |
OPEN_SIDE: 'side', | |
OPEN_MASTER: 'master' | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function blist () { | |
git br --sort=-committerdate --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:green)%(committerdate:relative)%(color:reset) - %(authorname)' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const toastMachine = Machine({ | |
id: 'toast', | |
initial: 'poweredOff', | |
states: { | |
poweredOff: { | |
on: { POWER_ON: 'poweredOn.hist' } | |
}, | |
poweredOn: { | |
on: { POWER_OFF: 'poweredOff' }, | |
type: 'parallel', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ifAtFirstYouDontSucceed = Machine({ | |
id: 'tryTryAgain', | |
initial: 'idle', | |
context: { | |
tries: 0 | |
}, | |
states: { | |
idle: { | |
on: { TRY: 'trying' } | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lightBulbMachine = Machine({ | |
id: 'lightBulb', | |
initial: 'unlit', | |
states: { | |
unlit: { | |
on: { | |
BREAK: 'broken', | |
TOGGLE: 'lit' | |
} | |
}, |