Expose Connection class as DDP.Connection


#1

As it stands, calling DDP.connect returns a Connection object upon which we can call all of our subscribe, methods, call, apply, etc. I’m trying something out where I’m passing the Connection object returned from Meteor.connection through my React components and calling the functions on it, instead of using the Meteor namespace. By doing this it will be an easy swap later if I want to have multiple DDP connections instead of just the default one.

As a good practice, I want to verify the type of the object (property in React-speak) being passed around but the Connection class isn’t exposed. What about attaching it under the DDP namespace, i.e. DDP.Connection. This adds some redundancy to the DDP.connect method if you could also just call new DDP.Connection(), but I don’t think that’s the worst thing in the world.