Created
June 29, 2016 09:52
-
-
Save n3ksus/e5a8caf21c8b5eaac73c6712094194fa to your computer and use it in GitHub Desktop.
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
(function (root, factory) { | |
if(typeof define === "function" && define.amd) { | |
define(["postal"], factory); | |
} else if(typeof module === "object" && module.exports) { | |
module.exports = factory(require("postal")); | |
} else { | |
root.myModule = factory(root.postal); | |
} | |
}(this, function(postal) { | |
var sub; | |
var ch = postal.channel("myModule"); | |
var myModule = { | |
sayHi:function() { | |
ch.publish("hey.yall", { msg: "myModule sez hai" }); | |
}, | |
dispose: function() { | |
sub.unsubscribe(); | |
} | |
}; | |
return myModule; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment