mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-15 20:24:51 +08:00
ae996b75f1
+ small fixes
34 lines
497 B
JavaScript
34 lines
497 B
JavaScript
|
|
import Promise from 'Promise';
|
|
import {isArray} from 'Common/Utils';
|
|
|
|
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;
|
|
(isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => {
|
|
if (fTrigger)
|
|
{
|
|
fTrigger(value);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|