Kargi-Sitesi/.angular/cache/18.2.11/babel-webpack/2f9cf68b730fc5e77b4c28945122c9de4e8ce5a81e40e9f63e5e7d4077604919.json

1 line
7.7 KiB
JSON
Raw Permalink Normal View History

2024-11-04 02:30:09 +00:00
{"ast":null,"code":"import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport class VirtualTimeScheduler extends AsyncScheduler {\n constructor(SchedulerAction = VirtualAction, maxFrames = Number.POSITIVE_INFINITY) {\n super(SchedulerAction, () => this.frame);\n this.maxFrames = maxFrames;\n this.frame = 0;\n this.index = -1;\n }\n flush() {\n const {\n actions,\n maxFrames\n } = this;\n let error, action;\n while ((action = actions[0]) && action.delay <= maxFrames) {\n actions.shift();\n this.frame = action.delay;\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n }\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\nVirtualTimeScheduler.frameTimeFactor = 10;\nexport class VirtualAction extends AsyncAction {\n constructor(scheduler, work, index = scheduler.index += 1) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.index = index;\n this.active = true;\n this.index = scheduler.index = index;\n }\n schedule(state, delay = 0) {\n if (!this.id) {\n return super.schedule(state, delay);\n }\n this.active = false;\n const action = new VirtualAction(this.scheduler, this.work);\n this.add(action);\n return action.schedule(state, delay);\n }\n requestAsyncId(scheduler, id, delay = 0) {\n this.delay = scheduler.frame + delay;\n const {\n actions\n } = scheduler;\n actions.push(this);\n actions.sort(VirtualAction.sortActions);\n return true;\n }\n recycleAsyncId(scheduler, id, delay = 0) {\n return undefined;\n }\n _execute(state, delay) {\n if (this.active === true) {\n return super._execute(state, delay);\n }\n }\n static sortActions(a, b) {\n if (a.delay === b.delay) {\n if (a.index === b.index) {\n return 0;\n } else if (a.index > b.index) {\n return 1;\n } else {\n return -1;\n }\n } else if (a.delay > b.delay) {\n return 1;\n } else {\n return -1;\n }\n }\n}","map":{"version":3,"names":["AsyncAction","AsyncScheduler","VirtualTimeScheduler","constructor","SchedulerAction","VirtualAction","maxFrames","Number","POSITIVE_INFINITY","frame","index","flush","actions","error","action","delay","shift","execute","state","unsubscribe","frameTimeFactor","scheduler","work","active","schedule","id","add","requestAsyncId","push","sort","sortActions","recycleAsyncId","undefined","_execute","a","b"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js"],"sourcesContent":["import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport class VirtualTimeScheduler extends AsyncScheduler {\n constructor(SchedulerAction = VirtualAction, maxFrames = Number.POSITIVE_INFINITY) {\n super(SchedulerAction, () => this.frame);\n this.maxFrames = maxFrames;\n this.frame = 0;\n this.index = -1;\n }\n flush() {\n const { actions, maxFrames } = this;\n let error, action;\n while ((action = actions[0]) && action.delay <= maxFrames) {\n actions.shift();\n this.frame = action.delay;\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n }\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\nVirtualTimeScheduler.frameTimeFactor = 10;\nexport class VirtualAction extends AsyncAction {\n constructor(scheduler, work, index = scheduler.index += 1) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.index = index;\n this.active = true;\n this.index = scheduler.index = index;\n }\n schedule(state, dela