![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ts.corals.io/frontend/node_modules/pusher-js/src/core/utils/timers/ |
import Timer from './abstract_timer'; import TimedCallback from './timed_callback'; import { Delay } from './scheduling'; // We need to bind clear functions this way to avoid exceptions on IE8 function clearTimeout(timer) { global.clearTimeout(timer); } function clearInterval(timer) { global.clearInterval(timer); } /** Cross-browser compatible one-off timer abstraction. * * @param {Number} delay * @param {Function} callback */ export class OneOffTimer extends Timer { constructor(delay: Delay, callback: TimedCallback) { super(setTimeout, clearTimeout, delay, function(timer) { callback(); return null; }); } } /** Cross-browser compatible periodic timer abstraction. * * @param {Number} delay * @param {Function} callback */ export class PeriodicTimer extends Timer { constructor(delay: Delay, callback: TimedCallback) { super(setInterval, clearInterval, delay, function(timer) { callback(); return timer; }); } }