我碰到了这段代码-布尔值在这段代码的一部分中起什么作用?
export class HammerConfig extends HammerGestureConfig {
buildHammer(element: HTMLElement): HammerManager {
return new Hammer.Manager(element, {
touchAction: 'auto',
inputClass: Hammer.TouchInput,
recognizers: [
[Hammer.Swipe, {
direction: Hammer.DIRECTION_HORIZONTAL
}]
]
});
}
}
if (someCondition) {
return Promise.resolve(oQueryInfo);
} else {
return this.myPromiseFunction(par1, par2, true, false).then(onResolve, onReject, false);
}
和oResolve
是回调函数。