代码拉取完成,页面将自动刷新
A simple throttle/debounce library for Dart developers.
Created from templates made available by Stagehand under a BSD-style license.
A simple usage example:
import 'dart:async';
import 'package:simple_throttle_debounce/simple_throttle_debounce.dart';
void main() async {
var limit = 100;
var tick = 0;
var interval = 1000;
var simpleTask = (tick, {name = 'simpleTask'}) => print('tick: $tick, name: $name');
dynamic throttleSimpleTask = throttle(simpleTask, interval);
dynamic debounceSimpleTask = debounce(simpleTask, interval);
while (true) {
print(tick);
throttleSimpleTask(tick, name: 'throttleSimpleTask');
debounceSimpleTask(tick, name: 'debounceSimpleTask');
await Future.delayed(Duration(milliseconds: 100), () => tick++);
if (tick > limit) break;
}
}
Please file feature requests and bugs at the issue tracker.
MIT License
Copyright (c) 2020 liudonghua
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。