mreaction:shadow-helpers

v0.3.1Published 10 years ago

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

shadow-helpers

This is an alternative to collection-helpers. This package use shadow-collections, which allows for multiple packages and the App devs to reuse collection transforms without conflicting with this package. Additionally is uses object definition, rather then function instantiation, for helpers.

Usage

1Example = new Mongo.Collection('example');
2Example.$helpers.test = function () {
3  return true;
4}
5Example.$helpers.constant = true
6
7var id = Example.insert({});
8var doc = Example.findOne(id);
9doc.test() //returns true
10doc.constant //returns true