a zip code crypto-currency system good for red ONLY

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { AsyncAction } from './AsyncAction';
  2. import { AsyncScheduler } from './AsyncScheduler';
  3. /**
  4. *
  5. * Async Scheduler
  6. *
  7. * <span class="informal">Schedule task as if you used setTimeout(task, duration)</span>
  8. *
  9. * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript
  10. * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating
  11. * in intervals.
  12. *
  13. * If you just want to "defer" task, that is to perform it right after currently
  14. * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),
  15. * better choice will be the {@link asap} scheduler.
  16. *
  17. * @example <caption>Use async scheduler to delay task</caption>
  18. * const task = () => console.log('it works!');
  19. *
  20. * Rx.Scheduler.async.schedule(task, 2000);
  21. *
  22. * // After 2 seconds logs:
  23. * // "it works!"
  24. *
  25. *
  26. * @example <caption>Use async scheduler to repeat task in intervals</caption>
  27. * function task(state) {
  28. * console.log(state);
  29. * this.schedule(state + 1, 1000); // `this` references currently executing Action,
  30. * // which we reschedule with new state and delay
  31. * }
  32. *
  33. * Rx.Scheduler.async.schedule(task, 3000, 0);
  34. *
  35. * // Logs:
  36. * // 0 after 3s
  37. * // 1 after 4s
  38. * // 2 after 5s
  39. * // 3 after 6s
  40. *
  41. * @static true
  42. * @name async
  43. * @owner Scheduler
  44. */
  45. export const async = new AsyncScheduler(AsyncAction);
  46. //# sourceMappingURL=async.js.map