snappymail/dev/Promises/AbstractBasic.js
djmaze e7180a86ce Made eslint using 'browser' environment and added globals, because RainLoop is used in browsers.
This also allowed to remove all webpack 'externals' overhead.
2020-08-12 00:25:36 +02:00

27 lines
426 B
JavaScript

export class AbstractBasicPromises {
oPromisesStack = {};
func(fFunc) {
fFunc();
return this;
}
fastResolve(mData) {
return Promise.resolve(mData);
}
fastReject(mData) {
return Promise.reject(mData);
}
setTrigger(trigger, value) {
if (trigger) {
value = !!value;
(Array.isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => {
if (fTrigger) {
fTrigger(value);
}
});
}
}
}