I have a function navigate that executes the followed code.:
navigate: config => {
Hype.relations.reduce((relation, nextRelation) => {
const url = getRelation(relation, config.from).href
const response = await axios.get(url)
return response
})
}
This error is displayed:
hype/src/hype.js: await is a reserved word
You need to add async to your function declaration.
Hype.relations.reduce(async (relation, nextRelation) => {
const url = getRelation(relation, config.from).href
const response = await axios.get(url)
return response
})
Thanks.
Thanks.
@enapupe thank you!
Most helpful comment
You need to add
asyncto your function declaration.