API extensions for Meteor core objects.
First, install the extended-api package from the command line, like so:
meteor add clinical:extended-api
Function, Client Toggle a variable true/false in the session.
//example
Session.setDefault("widgetIsOpen", false);
Template.myTemplate.events({
'click #displayWidgetButton':function(){
Session.toggle("widgetIsOpen");
}
});
Function, Client
Toggle a variable true/false in the session.
//example
Session.setDefault("selectedPurchaseItemId", Meteor.user().profile.selectedItemId);
Template.myTemplate.events({
'click #emptyShoppingCart':function(){
Session.clear("selectedPurchaseItemId");
}
});
Function, Server Drop the entire collection.
var Foo = new Mongo.Collection(null);
Foo.insert({text: "foo"});
Foo.drop();
View the TinyTests results by doing the following:
cd myapp/packages/extended-api
meteor test-packages
MIT License. Use as you will.