Created
October 2, 2023 10:56
-
-
Save amcsi/241bef0021cb350f8f4b1ff0fe61f421 to your computer and use it in GitHub Desktop.
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
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