longshotlabs / meteor-template-extension

A Meteor package: Replace already defined templates, inherit helpers and events from other templates
https://atmospherejs.com/aldeed/template-extension
MIT License
220 stars 20 forks source link

Add set to TemplateInstance #45

Closed merlinstardust closed 7 years ago

merlinstardust commented 8 years ago

I would have preferred to use the get method already set up but that only would have worked with the reactive-var package. This works regardless of if you have it.

mitar commented 8 years ago

Ha? Here are some assumptions that any field on the template instance when you have reactive var package is a reactive var? This is a bit hard assumption. You should do some instanceof check.

merlinstardust commented 8 years ago

You mean instead of doing if (Package['reactive-var']), I should do if (previousValue instanceof ReactiveVar)?

mitar commented 8 years ago

if (Package['reactive-var'] && previousValue instanceof Package['reactive-var'].ReactiveVar) or something like that.

merlinstardust commented 8 years ago

Added