##// END OF EJS Templates
Minor fixes and improvements...
Minor fixes and improvements - added `isCancellable` type predicate function to `safe` module - `isString, isNumber, isInteger, isPrimitive` are now type predicates

File last commit:

r51:43a2828f8abe v1.2.0-rc di-typescript
r71:600f0201c4ba v1.2.16 default
Show More
Destination.js
34 lines | 985 B | application/javascript | JavascriptLexer
define([ "dojo/_base/declare", "./Listener" ],
function(declare, Listener) {
return declare(null, {
_session : null,
_destination : null,
_listenerClass : null,
constructor : function(session, destination, options) {
if (!session)
throw new Error("A session is required");
if (!destination)
throw new Error("A destination is required");
this._session = session;
this._destination = destination;
if (options) {
if (options.listenerClass)
this._listenerClass = options.listenerClass;
}
},
listen : function(callback) {
var factory = this._listenerClass || Listener;
var listener = new factory(this._session, this._destination, {
listener : callback
});
listener.start();
return listener;
}
});
});