Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block tradewind2018

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tradewind2018 / pubsub.js
Created Mar 14, 2018 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
View pubsub.js
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {[eventName] =[eventName] || [];[eventName].push(fn);
off: function(eventName, fn) {
if ([eventName]) {
You can’t perform that action at this time.