mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-09 16:28:00 +08:00
8da988fef2
Update package.json dependencies Fix eslint errors webpack 2 -> webpack 3
34 lines
509 B
JavaScript
34 lines
509 B
JavaScript
|
|
import window from 'window';
|
|
import {isArray} from 'Common/Utils';
|
|
|
|
export class AbstractBasicPromises
|
|
{
|
|
oPromisesStack = {};
|
|
|
|
func(fFunc) {
|
|
fFunc();
|
|
return this;
|
|
}
|
|
|
|
fastResolve(mData) {
|
|
return window.Promise.resolve(mData);
|
|
}
|
|
|
|
fastReject(mData) {
|
|
return window.Promise.reject(mData);
|
|
}
|
|
|
|
setTrigger(trigger, value) {
|
|
if (trigger)
|
|
{
|
|
value = !!value;
|
|
(isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => {
|
|
if (fTrigger)
|
|
{
|
|
fTrigger(value);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|