PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
node_modules
/
rxjs
/
_esm2015
/
internal
/
scheduler
import { Action } from './Action'; export class AsyncAction extends Action { constructor(scheduler, work) { super(scheduler, work); this.scheduler = scheduler; this.work = work; this.pending = false; } schedule(state, delay = 0) { if (this.closed) { return this; } this.state = state; const id = this.id; const scheduler = this.scheduler; if (id != null) { this.id = this.recycleAsyncId(scheduler, id, delay); } this.pending = true; this.delay = delay; this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); return this; } requestAsyncId(scheduler, id, delay = 0) { return setInterval(scheduler.flush.bind(scheduler, this), delay); } recycleAsyncId(scheduler, id, delay = 0) { if (delay !== null && this.delay === delay && this.pending === false) { return id; } clearInterval(id); return undefined; } execute(state, delay) { if (this.closed) { return new Error('executing a cancelled action'); } this.pending = false; const error = this._execute(state, delay); if (error) { return error; } else if (this.pending === false && this.id != null) { this.id = this.recycleAsyncId(this.scheduler, this.id, null); } } _execute(state, delay) { let errored = false; let errorValue = undefined; try { this.work(state); } catch (e) { errored = true; errorValue = !!e && e || new Error(e); } if (errored) { this.unsubscribe(); return errorValue; } } _unsubscribe() { const id = this.id; const scheduler = this.scheduler; const actions = scheduler.actions; const index = actions.indexOf(this); this.work = null; this.state = null; this.pending = false; this.scheduler = null; if (index !== -1) { actions.splice(index, 1); } if (id != null) { this.id = this.recycleAsyncId(scheduler, id, null); } this.delay = null; } } //# sourceMappingURL=AsyncAction.js.map
[-] animationFrame.js.map
[edit]
[-] AsyncScheduler.js
[edit]
[+]
..
[-] QueueScheduler.js
[edit]
[-] asap.js.map
[edit]
[-] AnimationFrameAction.js
[edit]
[-] queue.js
[edit]
[-] AsapScheduler.js.map
[edit]
[-] AsapAction.js.map
[edit]
[-] async.js.map
[edit]
[-] VirtualTimeScheduler.js.map
[edit]
[-] QueueAction.js
[edit]
[-] AsyncScheduler.js.map
[edit]
[-] AnimationFrameScheduler.js
[edit]
[-] AsyncAction.js
[edit]
[-] Action.js.map
[edit]
[-] asap.js
[edit]
[-] async.js
[edit]
[-] AsyncAction.js.map
[edit]
[-] AsapScheduler.js
[edit]
[-] AsapAction.js
[edit]
[-] QueueScheduler.js.map
[edit]
[-] animationFrame.js
[edit]
[-] QueueAction.js.map
[edit]
[-] AnimationFrameAction.js.map
[edit]
[-] AnimationFrameScheduler.js.map
[edit]
[-] queue.js.map
[edit]
[-] Action.js
[edit]
[-] VirtualTimeScheduler.js
[edit]