diff options
Diffstat (limited to 'templates.js')
-rw-r--r-- | templates.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/templates.js b/templates.js new file mode 100644 index 0000000..1e35ba6 --- /dev/null +++ b/templates.js @@ -0,0 +1,15 @@ +// Create a module to keep +// our template functions +// out of the global scope +let Templates = (function() { + return { + // Allowing an id to be passed in is very useful + // for finding this node after it gets mounted + circle(id = '') { + return `<circle class="circle" id="${id}" r="4"/>` + }, + svg(id = '', children) { + return `<svg class="container" id="${id}">${children}</svg>` + } + } +})() |