p
Size: a a a
p
В
В
p
В
В
В
В
p
В
В
В
p
В
В
p
p
p
const fxNames = ['fetchMovie', 'fetchCredits', 'fetchMovieImages']
const template = fxName =>
`
const ${fxName}Fx = createEffect(
async id => {
const req = await API.${fxName}(id)
req.ok && await req.json()
throw Error(req.statusText)
}
)
`
const generatedFxs = fxNames.reduce((acc, el) => {
acc.push(template(el))
return acc
}, [])
В
В