Skip to content

Instantly share code, notes, and snippets.

@pranavgarg
Created June 23, 2015 15:40
Show Gist options
  • Save pranavgarg/e33acfcf72201b58a40e to your computer and use it in GitHub Desktop.
Save pranavgarg/e33acfcf72201b58a40e to your computer and use it in GitHub Desktop.
Meteor Best Practices
###
Install: meteor add audit-argument-checks
Description: This package will do type checking for the arguments.
E.g. Publish function sending data back based on the username
###
Meteor.publish({
"posts": (currentUserName) ->
check currentUserName, String #this line does the typechecking. If missed following error thrown Exception from sub posts id .. Did not check() all arguments during publisher
Posts.find({author: currentUserName}).fields({})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment