Javascript Namespaces in Meteor

I’ve just been watching this excellent EventedMind presentation to get my head around routing for Meteor. I’ve realized that a better way to manage my code (particularly for subscriptions) is to harness the power of javascript namespaces. For example

Subscriptions = {
posts: Meteor.subscribe('posts')
};

Just keeps everything much cleaner, and prevents quite likely name conflicts. I think I’ll be using this from now on in the ongoing Fixer’s Dream development!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s