I ' am trying to retrieve some data from an async function without success, here is the code :
links(originalArray = "/views/layouts/footer-links.json"){
let [template, dataset] = async function () {
let html = null,
// Get the post data
response = await fetch(originalArray),
dataset = await response.json(),
template = dataset.footerLinks.map(header=>{
const html = `
<div class="cell medium-3">
<h4 title="${header.type}">${header.text}</h4>
<ul class="menu vertical">
${header.anchors.map(link=>`
<li> ${link.label} </li>
`).join("")}
</ul>
</div>
`;
return html;
}).join(""); ;
return html = {
template: template,
dataset: dataset
};
};
console.log(("In getDataset:::. ",[template, dataset]));
return [template, dataset];
}
here is the error i am getting
i understand what the message means but i don't know how to get around it.
