xorax:multiple-callbacks

v0.1.4Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

meteor-multiple-callbacks

Multiple template callbacks implementation for Meteor.

The main purpose of this package is providing support of multiple created/rendered/destroyed callbacks for Meteor templates.

Usage

Add the package to your app:

meteor add xorax:multiple-callbacks

Add callbacks to your templates using the following API:

1Template.created('template_name', function(){...})
2Template.rendered('template_name', function(){...})
3Template.destroyed('template_name', function(){...})

You can omit template name parameter. In this case the handler will be applied to all your templates:

1Template.rendered(function(){...})

Also you can apply the callback to multiple templates at once:

1Template.created('template_name1', 'template_name2', 'template_name3', function(){...})