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
export interface PromptAttributes { | |
text: string; | |
// Use the native key hash to set the control | |
control: number; | |
mode?: "standard" | "hold" | "mash" | "mash_infinite"; | |
mashAmount?: number; | |
// When using mash mode this function is called indefinitely, make sure to either handle this properly | |
// Or to utilise "once" from Lodash for example to make sure the function is only called once. | |
onSuccess: Function; | |
// Only called during mash mode. |
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 fetchMachine = Machine({ | |
id: 'fetch', | |
initial: 'preprocessing', | |
context: { | |
retries: 0, | |
}, | |
states: { | |
preprocessing: { | |
on: { | |
ERROR: 'manualIntervention', |