Class: Raf
优化的 raf 管理
const raf = new Raf();
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Raf(cb
, options?
): Raf
Parameters
Name | Type |
---|---|
cb | any |
options | Partial <RafOptions > |
Returns
Defined in
Properties
options
• options: Partial
<RafOptions
>
Defined in
Accessors
visible
• get
visible(): boolean
获取当前页面是否可见
Returns
boolean
Defined in
animating
• get
animating(): boolean
获取当前raf
状态
Returns
boolean
Defined in
elapsedTime
• get
elapsedTime(): number
获取总时长
Returns
number
Defined in
Methods
reset
▸ reset(): void
重置当前 raf
状态
Returns
void
Defined in
start
▸ start(): void
启动 raf
Returns
void
Defined in
stop
▸ stop(): void
停止 raf
Returns
void
Defined in
tick
▸ tick(): void
Returns
void