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

31 lines
529 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;