Last active
September 22, 2015 21:24
-
-
Save americodls/9696833 to your computer and use it in GitHub Desktop.
Pub/Sub pattern using only jQuery.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.mediator = $({}); | |
$(function() { | |
mediator.on("foo:bar", fooBar); | |
mediator.trigger("foo:bar"); | |
}); | |
function fooBar(event) { | |
alert("Foo Bar"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment