Here’s a simple message bus/broker I wrote for Ext.js 4 Ext.define('Ext.ux.MessageBroker', { extend: 'Ext.util.Observable', statics: { instance: null, setInstance: function(i) { this.instance = i; }, sendMessage: function(msg, data) { this.fireEvent('message',{"msg":msg,"data":data}); } }, constructor: function(config){ this.addEvents({ "message" : true }); if(config && config.listeners) this.listeners = config.listeners; Ext.ux.MessageBroker.superclass.constructor.call(this, config) } }, function() […]

Simple message bus for extjs 4

Recently I embarked on a quest to design a framework which would help us keep track of large and complex javascript projects in easily identifiable and extendable patterns. After some thought and deliberation, we eventually settled on the observer pattern using Ext’s Ext.util.Observable object as the base object to use […]

Primitive OOP observer pattern with ExtJS