1
0
mirror of https://github.com/krawieck/lemmur/ synced 2024-12-23 22:31:03 +01:00

add default for delayed loading

This commit is contained in:
shilangyu 2020-09-19 12:27:57 +02:00
parent 016537d8d2
commit 30adc2be63

View File

@ -22,7 +22,8 @@ class DelayedLoading {
/// When loading is [.start()]ed, it goes into a pending state
/// and loading is triggered after [delayDuration].
/// Everything can be reset with [.cancel()]
DelayedLoading useDelayedLoading(Duration delayDuration) {
DelayedLoading useDelayedLoading(
[Duration delayDuration = const Duration(milliseconds: 500)]) {
final loading = useState(false);
final pending = useState(false);
final timerHandle = useRef<Timer>(null);