Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 1.13 KB

File metadata and controls

65 lines (48 loc) · 1.13 KB

clinical:extended-api

API extensions for Meteor core objects.

Installation

First, install the extended-api package from the command line, like so:

meteor add clinical:extended-api

API

Session.toggle(key)

Function, Client Toggle a variable true/false in the session.

//example
Session.setDefault("widgetIsOpen", false);

Template.myTemplate.events({
  'click #displayWidgetButton':function(){
    Session.toggle("widgetIsOpen");
  }
});

Session.clear(key)

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");
  }
});

Mongo.Collection.drop()

Function, Server Drop the entire collection.

var Foo = new Mongo.Collection(null);
Foo.insert({text: "foo"});
Foo.drop();

Testing

View the TinyTests results by doing the following:

cd myapp/packages/extended-api
meteor test-packages

Licensing

MIT License. Use as you will.