executeSchedule.js 505 B

12345678910111213141516
  1. export function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) {
  2. const scheduleSubscription = scheduler.schedule(function () {
  3. work();
  4. if (repeat) {
  5. parentSubscription.add(this.schedule(null, delay));
  6. }
  7. else {
  8. this.unsubscribe();
  9. }
  10. }, delay);
  11. parentSubscription.add(scheduleSubscription);
  12. if (!repeat) {
  13. return scheduleSubscription;
  14. }
  15. }
  16. //# sourceMappingURL=executeSchedule.js.map