From 0c660238f2eb57d4bb271d9ded170c1725ec1c29 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 27 May 2016 11:49:43 -0700 Subject: [PATCH] [API] Add MCT class --- index.html | 2 +- main.js | 18 +++++++++++------- src/MCT.js | 13 +++++++++++++ 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/MCT.js diff --git a/index.html b/index.html index e16b096abb..c5ff002029 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ './example/imagery/bundle', './example/eventGenerator/bundle', './example/generator/bundle' - ], mct.run.bind(mct)); + ], mct.start.bind(mct)); }); diff --git a/main.js b/main.js index 579b33dc4f..561c6e8b79 100644 --- a/main.js +++ b/main.js @@ -62,6 +62,7 @@ requirejs.config({ define([ './platform/framework/src/Main', 'legacyRegistry', + './src/MCT', './platform/framework/bundle', './platform/core/bundle', @@ -97,11 +98,14 @@ define([ './platform/search/bundle', './platform/status/bundle', './platform/commonUI/regions/bundle' -], function (Main, legacyRegistry) { - return { - legacyRegistry: legacyRegistry, - run: function () { - return new Main().run(legacyRegistry); - } - }; +], function (Main, legacyRegistry, MCT) { + var mct = new MCT(); + + mct.legacyRegistry = legacyRegistry; + mct.run = mct.start; + mct.on('start', function () { + return new Main().run(legacyRegistry); + }); + + return mct; }); diff --git a/src/MCT.js b/src/MCT.js new file mode 100644 index 0000000000..4999e5e548 --- /dev/null +++ b/src/MCT.js @@ -0,0 +1,13 @@ +define(['EventEmitter'], function (EventEmitter) { + function MCT() { + EventEmitter.call(this); + } + + MCT.prototype = Object.create(EventEmitter.prototype); + + MCT.prototype.start = function () { + this.emit('start'); + }; + + return MCT; +});