I'm trying to make my generator more flexible
From this:
function *formValidationSequence () {
yield someRef.current.func()
yield someOtherRef.current.func()
...
}
To this:
const array = [someRef, someOtherRef]
const handler = (array) => {
const sequence = testSequence(function *() {
yield* array.map(item => item.current.func())
})
}
But it doesn't work. I want to create yield dynamically for every ref/item in an array, without to call 'em instantly.
How it should be done?