You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varMediator=require('custom-evt-manager');//var mediator = new Mediator("JED" "custpmEvtMgr"); //Add to JED.customEvtMgr instead of default.//ensures a single global mediator obj at default location (FS.evtMediator)varmediator=newMediator();mediator.subscribe("chat",logChatEvent);mediator.subscribe("chat::message",displayMessage);// 'chat' and 'chat::message' will fire because of namespacingmediator.publish("chat::message","shaggy87","lol dope");//SCOPE instances by adding a unique ID to the namespacemediator.publish("dropdown::sign-in-dd::open","dropdown::sign-in-dd:open has fired","lol dope");mediator.subscribe("dropdown::sign-in-dd::open",callback);
Unsubscribe from channel. If only channel is given all callbacks that match the channels namspace will be
removed. If callback is given it will only remove subscriptions that has that specific callback
Mediator.prototype.publish( channel, args.. )
Publishes to the channel, calling all subscribing callbacks with the rest of the arguments as arguments
to the calback function[s].
License
MIT
About
Sets up a global mediator which pub-subs custom events across components.