If your use case is simple enough, go straight ahead:
You can use it on arbitrary objects.
var obj = {};$(obj).on(...) .
Note that if you use it in a document, you are effectively creating a global hidden dependency. In addition, renting your own pubsub for the client side is ~ 20 LoC, so there’s another consideration, since the jQuery dependency is not something you always would like to have.
Benjamin gruenbaum
source share