This pattern is cool! It spawned a long discussion last night about how to handle hooks in general, and a plan for a better public API for hooks (eg replacing Meteor.onConnection and these login hooks with a different syntax).

I think it's probably better to go ahead with this syntax for now, get it merged and shipped, then do the new API as a separate project. More API churn for users, but I think tactically easier to build.

For now, can we just put a big XXX comment at the top here warning people off using this in more places in the mean time. Something like:

XXX this pattern is under development. Do not add more callsites using this package for now.