mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-15 20:24:51 +08:00
ea48f5060b
isUnd(*) to native undefined === * isFunc to native typeof * === 'function' isObject to native typeof * === 'object' microtime() to native Date().getTime(); noop to native ()=>{} noopFalse to native ()=>false noopTrue to native ()=>true boolToAjax to native *?'1':'0' Underscore.js to native
29 lines
470 B
JavaScript
29 lines
470 B
JavaScript
import window from 'window';
|
|
|
|
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;
|
|
(Array.isArray(trigger) ? trigger : [trigger]).forEach((fTrigger) => {
|
|
if (fTrigger) {
|
|
fTrigger(value);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|