(function () { _listeners = {}; const dhiStore = { dispatch: function(action) { if(action.type && _listeners[action.type]) { for (let i = 0; i < _listeners[action.type].length; i++) { _listeners[action.type][i](action); } } }, addListener: function(name, listener) { const listeners = _listeners[name] || []; listeners.push(listener); _listeners[name] = listeners; } }; window.dhiStore = dhiStore; window.dispatchEvent(new Event('DHI Store Initialized')); })();