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

31 lines
529 B
JavaScript
Raw Normal View History

2019-12-02 12:22:45 +00:00
function Test() {}
// this doesnt return an object?? 🤡
// Test.prototype.data = () => { name: "Ted" };
Test.prototype.data = () => {
return { name: "Ted" };
};
Test.prototype.render = ({ name }) => `<p>${name}</p>`;
/*
Test.prototype.data = function() {
return { name: "Ted" };
};
Test.prototype.render = function(data) {
return `<p>${data.name}</p>`;
}
*/
/*
// this isnt valid syntax?? 🤡
class Test {
data() => {
name: "Ted"
};
render({ name }) => `<p>${name}</p>`;
}
*/
module.exports = Test;