Created
April 9, 2015 11:46
-
-
Save peterchoo/1c977753b2d44f5e44c1 to your computer and use it in GitHub Desktop.
Sample helper package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyObject = {}; | |
/** | |
* Common functions | |
*/ | |
MyObject.common = function() {}; | |
/** | |
* Client only | |
*/ | |
if (Meteor.isClient) { | |
MyObject.client = function() {}; | |
} | |
/** | |
* Server only | |
*/ | |
if (Meteor.isServer) { | |
MyObject.server = function() {}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Package.onUse(function(api) { | |
api.versionsFrom('1.1.0.2'); | |
/** | |
* Common must be loaded first. | |
*/ | |
api.addFiles('helper.js'); | |
api.export('MyObject'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment