{"map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/try-again/index.ts\"],\"names\":[],\"mappings\":\"AAAA,YAAY,CAAA;AAOZ,MAAM,QAAQ;IAMZ,YAAa,IAAc,EAAE,OAAgB;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAA;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;IACvB,CAAC;IAED,GAAG;QACD,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC;YAAE,OAAO,KAAK,CAAA;QACjC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAC/B,IAAI,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC;gBAAE,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAA;QACjD,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;IAED,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,CAAE,IAAY;QAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;IACrB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,EAAE,CAAA;QACX,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;IAChB,CAAC;CACF;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA\",\"sourcesContent\":[\"'use strict'\\n\\ntype options = {\\n  polls: number\\n  timeout: number\\n}\\n\\nclass TryAgain {\\n  public polls: number\\n  private task: Function\\n  private timeout: number\\n  private timeoutId: any\\n\\n  constructor (task: Function, options: options) {\\n    this.task = task\\n    this.polls = options.polls || 2\\n    this.timeout = options.timeout || 3000\\n    this.timeoutId = null\\n  }\\n\\n  try () {\\n    if (this.polls <= 0) return false\\n    this.timeoutId = setTimeout(() => {\\n      if (this.polls-- > 0) this.task() && this.try()\\n    }, this.timeout)\\n  }\\n\\n  stop () {\\n    clearTimeout(this.timeoutId)\\n  }\\n\\n  wait (time: number) {\\n    this.timeout = time\\n  }\\n\\n  over () {\\n    this.stop()\\n    this.polls = 0\\n  }\\n}\\n\\nexport { TryAgain }\\n\"]}","code":"'use strict';\r\nclass TryAgain {\r\n    constructor(task, options) {\r\n        this.task = task;\r\n        this.polls = options.polls || 2;\r\n        this.timeout = options.timeout || 3000;\r\n        this.timeoutId = null;\r\n    }\r\n    try() {\r\n        if (this.polls <= 0)\r\n            return false;\r\n        this.timeoutId = setTimeout(() => {\r\n            if (this.polls-- > 0)\r\n                this.task() && this.try();\r\n        }, this.timeout);\r\n    }\r\n    stop() {\r\n        clearTimeout(this.timeoutId);\r\n    }\r\n    wait(time) {\r\n        this.timeout = time;\r\n    }\r\n    over() {\r\n        this.stop();\r\n        this.polls = 0;\r\n    }\r\n}\r\nexport { TryAgain };\r\n//# sourceMappingURL=index.js.map"}
