work.suroh.tk/node_modules/@11ty/eleventy/test/stubs/class-async-data-fn.11ty.js

18 lines
265 B
JavaScript

class Test {
async data() {
return new Promise((resolve, reject) => {
setTimeout(function() {
resolve({
name: "Ted"
});
}, 50);
});
}
render({ name }) {
return `<p>${name}</p>`;
}
}
module.exports = Test;