Skip to content

Instantly share code, notes, and snippets.

View theninthnode's full-sized avatar

Billy Jones theninthnode

View GitHub Profile
@netpoetica
netpoetica / decoupling-dependencies
Created October 16, 2014 18:53
Even more decoupled than the original - pass dependencies in as args so that they can be easily changed later
document.addEventListener("DOMContentLoaded", function(event) {
/*
Later you can easily change this to any other PubSub library you like.
var _pubSub = PubSub;
or you can even wrap it to define your own API. This way, later on
you can still continue to use _ps.sub and _ps.pub even if you change
out the library defining that behaviour. Let's go with the latter.