mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added Server Factory module and empty notification center. #6
This commit is contained in:
parent
3899d9b018
commit
f3e186afb1
2 changed files with 31 additions and 0 deletions
24
lib/Server/Factory.js
Normal file
24
lib/Server/Factory.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
define(['Server/NotificationCenter'], function(NotificationCenter) {
|
||||
|
||||
function Factory() {
|
||||
this.notificationCenter = new NotificationCenter();
|
||||
}
|
||||
|
||||
Factory.prototype.new = function () {
|
||||
|
||||
if (arguments.length < 1)
|
||||
throw 'Too fiew arguments';
|
||||
if (typeof arguments[0] != 'function')
|
||||
throw arguments[0] + ' is not a function';
|
||||
|
||||
var type = arguments[0];
|
||||
var object = new (type.bind.apply(type,arguments))();
|
||||
object.notificationCenter = this.notificationCenter;
|
||||
object.factory = this;
|
||||
return object;
|
||||
|
||||
}
|
||||
|
||||
return Factory;
|
||||
|
||||
});
|
||||
7
lib/Server/NotificationCenter.js
Normal file
7
lib/Server/NotificationCenter.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function() {
|
||||
|
||||
function NotificationCenter() {
|
||||
}
|
||||
|
||||
return NotificationCenter;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue