From caf66fba42ec3586cce86f27037d4a63832e3d81 Mon Sep 17 00:00:00 2001 From: b3ngr33ni3r Date: Sun, 23 Feb 2014 00:30:02 -0500 Subject: [PATCH] added support for amd --- multiplex_client.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/multiplex_client.js b/multiplex_client.js index d007b63..6596e1c 100644 --- a/multiplex_client.js +++ b/multiplex_client.js @@ -84,3 +84,13 @@ var WebSocketMultiplex = (function(){ return WebSocketMultiplex; })(); + +//support multiple js loaders (browser,amd,node) +if (typeof define === "function" && define.amd) { + define(function () { + return WebSocketMultiplex; + }); +} else { + root = typeof exports !== "undefined" && exports !== null ? exports : this; + root.WebSocketMultiplex = WebSocketMultiplex; +} \ No newline at end of file