# 引入
import { PollingRequest } from 't-comm';
// or
import { PollingRequest } from 't-comm/lib/polling/index';
# PollingRequest
参数:
# new PollingRequest([maxPollingTime], [timeInterval])
轮询
Param | Type | Default | Description |
---|---|---|---|
[maxPollingTime] | number | 10 | 最大轮询次数 |
[timeInterval] | number | 2000 | 轮询间隔 |
Example
const polling = new PollingRequest(10);
const cb = () => {
this.onGetTeamList(true);
};
polling.polling(cb);
# pollingRequest.reset()
重置,即取消轮询
Kind: instance method of PollingRequest
# pollingRequest.polling(func)
开始轮询
Kind: instance method of PollingRequest
Param | Type | Description |
---|---|---|
func | function | 轮询方法 |