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

Use the offical API for adding inherited helpers to the template #39

Closed dalgard closed 8 years ago

dalgard commented 9 years ago

I'm creating a package that wraps the two core methods for setting and retrieving helpers on a template – Template.prototype.helpers and Blaze._getTemplateHelper (even if the latter isn't official) – in order to make the two methods reactive, like ReactiveDict.

This way, a helper that is added after the template is rendered (or while it is being rendered), will still become active. This is discussed here.

The problem with wrapping the two methods is if someone writes directly to the __helpers map, and I think your package is by far the most popular package that does this.

Please merge this tiny pull request to support the pattern above. Thanks :)

dalgard commented 9 years ago

The package I've created hasn't been released yet, but can be found here: nordlys:get-helper-reactively

aldeed commented 8 years ago

Thanks @dalgard! I released 4.0 with a complete rewrite that includes this change.