Skip to content

Instantly share code, notes, and snippets.

@amcsi
Created October 2, 2023 10:56
Show Gist options
  • Save amcsi/241bef0021cb350f8f4b1ff0fe61f421 to your computer and use it in GitHub Desktop.
Save amcsi/241bef0021cb350f8f4b1ff0fe61f421 to your computer and use it in GitHub Desktop.
import PrintA from '../PrintA';
export const printConfig = {
A: {
component: PrintA,
nextTransaction: 'B',
},
B
}
export const printConfig = [
{
transactionName: 'A',
component: PrintA,
},
{
transactionName: 'B',
component: PrintB,
},
]
const stateDefinition = {
...,
inTransaction: {
...
},
}
for (const [index, transaction] of printConfig) {
stateDefinition[transaction] = {
on: {
done: {
'toTo': printConfig[index + 1].transactionName
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment