refactor: replace until loop with map
This commit is contained in:
parent
93873306a9
commit
2e3e050c54
1 changed files with 12 additions and 18 deletions
|
|
@ -46,24 +46,18 @@ const Wizard = ({ machine, locale, onClose, save, error }) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const steps = []
|
const steps = R.map(
|
||||||
|
it => ({
|
||||||
R.until(
|
type: `cassette${it}`,
|
||||||
R.gt(R.__, machine.numberOfCassettes),
|
display: `Cassette ${it}`,
|
||||||
it => {
|
component: Autocomplete,
|
||||||
steps.push({
|
inputProps: {
|
||||||
type: `cassette${it}`,
|
options: R.map(it => ({ code: it, display: it }), options),
|
||||||
display: `Cassette ${it}`,
|
labelProp: 'display',
|
||||||
component: Autocomplete,
|
valueProp: 'code'
|
||||||
inputProps: {
|
}
|
||||||
options: R.map(it => ({ code: it, display: it }))(options),
|
}),
|
||||||
labelProp: 'display',
|
R.range(1, machine.numberOfCassettes + 1)
|
||||||
valueProp: 'code'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return R.add(1, it)
|
|
||||||
},
|
|
||||||
1
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const schema = () =>
|
const schema = () =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue