本文整理汇总了TypeScript中@aurelia/kernel.PLATFORM.requestAnimationFrame方法的典型用法代码示例。如果您正苦于以下问题:TypeScript PLATFORM.requestAnimationFrame方法的具体用法?TypeScript PLATFORM.requestAnimationFrame怎么用?TypeScript PLATFORM.requestAnimationFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@aurelia/kernel.PLATFORM
的用法示例。
在下文中一共展示了PLATFORM.requestAnimationFrame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: verifyCalled
PLATFORM.requestAnimationFrame(() => {
obj1.foo = obj2.foo = `${++frameCount + 1}`;
verifyCalled(7);
PLATFORM.requestAnimationFrame(() => {
obj1.foo = obj2.foo = `${++frameCount + 1}`;
verifyCalled(8);
PLATFORM.requestAnimationFrame(() => {
obj1.foo = obj2.foo = `${++frameCount + 1}`;
verifyCalled(9);
PLATFORM.requestAnimationFrame(() => {
obj1.foo = obj2.foo = `${++frameCount + 1}`;
verifyCalled(10);
PLATFORM.requestAnimationFrame(() => {
obj1.foo = obj2.foo = `${++frameCount + 1}`;
verifyCalled(11);
observer1.unsubscribe(subscriber1);
observer1.unsubscribe(subscriber2);
observer2.unsubscribe(subscriber3);
observer2.unsubscribe(subscriber4);
done();
});
});
});
});
});
示例2: expect
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
observer.unsubscribe(subscriber);
done();
});
});
示例3: it
it('does nothing if disabled', function(done) {
const framesPerCheck: number = 1;
DirtyCheckSettings.framesPerCheck = framesPerCheck;
DirtyCheckSettings.disabled = true;
const { dirtyChecker } = setup();
const obj = { foo: '0' };
const observer = dirtyChecker.createProperty(obj, 'foo');
let callCount: number = 0;
const subscriber = {
handleChange() {
++callCount;
}
};
observer.subscribe(subscriber);
obj.foo = `1`;
expect(callCount).to.equal(0);
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
PLATFORM.requestAnimationFrame(() => {
expect(callCount).to.equal(0);
observer.unsubscribe(subscriber);
done();
});
});
});
});
});
});