mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-07 23:38:14 +08:00
e7180a86ce
This also allowed to remove all webpack 'externals' overhead.
27 lines
426 B
JavaScript
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);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|