muu

DEPRECATED lightweight JS framework
git clone https://git.ce9e.org/muu.git

commit
9e6590795c4afe40ba308e9d15d26c627828b330
parent
cb0b88e0a8a24b60d220ef053f140f9a9abfcdc3
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-08-28 19:27
add template cache

Diffstat

M src/muu-template.js 7 ++++++-

1 files changed, 6 insertions, 1 deletions


diff --git a/src/muu-template.js b/src/muu-template.js

@@ -209,7 +209,12 @@ define('muu-template', ['muu-js-helpers', 'muu-dom-helpers'], function(_, $) {
  209   209         }
  210   210     };
  211   211 
   -1   212     var cache = {};
   -1   213 
  212   214     return function(template, data) {
  213    -1         return parseTemplate(template).render(data);
   -1   215         if (cache[template] === undefined) {
   -1   216             cache[template] = parseTemplate(template);
   -1   217         }
   -1   218         return cache[template].render(data);
  214   219     };
  215   220 });