Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
engine.should.be.an.instanceOf(_Engine);
}
Object.assign(this, {
_engine: engine,
lifespan: new Lifespan(),
});
_.bindAll(this, [
'onUpdate',
'onDelete',
]);
if(__DEV__) {
this._onUpdateHandlers = 0;
this._onDeleteHandlers = 0;
// check that handlers are immediatly set
asap(() => {
try {
this._onUpdateHandlers.should.be.above(0);
this._onDeleteHandlers.should.be.above(0);
}
catch(err) {
console.warn('StoreConsumer: both onUpdate and onDelete handlers should be set immediatly.');
}
});
}
}
constructor(engine) {
if(__DEV__) {
engine.should.be.an.instanceOf(_Engine);
}
Object.assign(this, {
_engine: engine,
lifespan: new Lifespan(),
});
_.bindAll(this, ['onDispatch']);
if(__DEV__) {
this._onDispatchHandlers = 0;
asap(() => { // check that handlers are immediatly set
try {
this._onDispatchHandlers.should.be.above(0);
}
catch(err) {
console.warn('StoreConsumer: onDispatch handler should be set immediatly.');
}
});
}
}
(function () {
'use strict';
var asap = require('asap');
// example from http://jsmodules.io
asap.default(function() {
console.log("hello async world!");
});
}).call(global);
(function () {
'use strict';
var asap = require('asap');
// example from http://jsmodules.io
asap.later(function() {
console.log("Running after other network events");
});
}).call(global);
if (alreadyInjected[key]) {
return;
}
if (!isBuffering) {
// We should never be automatically buffering on the server (or any
// place without a document), so guard against that.
if (typeof document === "undefined") {
throw new Error(
"Cannot automatically buffer without a document");
}
// If we're not already buffering, schedule a call to flush the
// current styles.
isBuffering = true;
asap(flushToStyleTag);
}
injectionBuffer.push(...generatedCSS);
alreadyInjected[key] = true;
}
var __imports_0 = require('asap');
var asap = __imports_0.default;
var later = __imports_0.later;
var __imports_0 = require('asap');
var asap = __imports_0.default;
var later = __imports_0.later;
removeSource(sourceId) {
invariant(this.getSource(sourceId), 'Expected an existing source.')
this.store.dispatch(removeSource(sourceId))
asap(() => {
delete this.handlers[sourceId]
delete this.types[sourceId]
})
}
removeTarget(targetId) {
invariant(this.getTarget(targetId), 'Expected an existing target.');
this.store.dispatch(removeTarget(targetId));
asap(() => {
delete this.handlers[targetId];
delete this.types[targetId];
});
}
function listener(data) {
nextData = data;
asap(flush);
}