Open zorbash opened 11 years ago
@zorbash, unfortunately, there isn't currently a way to do this with tim. Everything is computed on-the-fly.
It's a good idea to have pre-computed templates, for performance, although I think it's likely that in most applications, the performance difference will be negligible. But no doubt there are situations where it will matter. I don't currently have any plans to implement it, but I'd happily review a pull request from someone.
Other javaScript templating engines support compiling the template text to a function which can then be called many times with different values without having the original template text be compiled again and again.
E.g in
underscore
templates:Is there any "hidden" way you can do that with tim?