Future<void> apply(Store<S> store, dynamic Function() state) async { while(!_shouldStop) { _closure(store, state() as S); await Future.delayed(_duration); } }