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 offlineMachine = Machine( | |
{ | |
id: 'offline', | |
initial: 'offline', | |
context: { | |
isForcedOffline: false, | |
}, | |
states: { | |
offline: { |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 pipelineItemMachine = Machine({ | |
id: 'pipelineItem', | |
initial: 'compact', | |
context: { | |
quotes: [] | |
}, | |
states: { | |
compact: { | |
on: { | |
EXPAND: 'fetching' |
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 pipelineMachine = Machine( | |
{ | |
id: 'pipeline', | |
initial: 'pipelineSearch', | |
context: { | |
pipelineQuery: '', | |
pipelineSearchIsDirty: false, | |
customerQuery: '', | |
dateFrom: '', | |
dateTo: '', |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 addressMachine = Machine({ | |
id: 'addresses', | |
initial: 'same_invoice_address', | |
context: { | |
address_line_1: '', | |
address_city: '', | |
address_postcode: '', | |
invoice_line_1: '', | |
invoice_city: '', | |
invoice_postcode: '', |
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 pageMachine = Machine({ | |
id: 'page', | |
initial: 'visible', | |
context: { | |
isSent: false, | |
}, | |
states: { | |
visible: { |
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
// npm i -S 'array-move' | |
// import arrayMove from 'array-move'; | |
const MIN_NUM_SURVEYS = 1; | |
const MAX_NUM_SURVEYS = 4; | |
const canAdd = context => context.surveys.length < MAX_NUM_SURVEYS; | |
const canClone = context => context.surveys.length < MAX_NUM_SURVEYS; | |
const canDelete = context => context.surveys.length > MIN_NUM_SURVEYS; |
NewerOlder