All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.animations.AnimationQueue.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/animations/AnimationQueue.ts"],
  "sourcesContent": ["type TaskType =\t() => Promise;\nconst tasks = new WeakMap>();\n\nclass AnimationQueue {\n\tstatic get tasks() {\n\t\treturn tasks;\n\t}\n\n\tstatic enqueue(element: HTMLElement, task: TaskType) {\n\t\tif (!tasks.has(element)) {\n\t\t\ttasks.set(element, []);\n\t\t}\n\n\t\ttasks.get(element)!.push(task);\n\t}\n\n\tstatic run(element: HTMLElement, task: TaskType): Promise {\n\t\tif (!tasks.has(element)) {\n\t\t\ttasks.set(element, []);\n\t\t}\n\n\t\treturn task().then(() => {\n\t\t\tconst elementTasks = tasks.get(element);\n\n\t\t\tif (elementTasks!.length > 0) {\n\t\t\t\treturn AnimationQueue.run(element, elementTasks!.shift()!);\n\t\t\t}\n\t\t\ttasks.delete(element);\n\t\t});\n\t}\n\n\tstatic push(element: HTMLElement, task: TaskType) {\n\t\tconst elementTasks = tasks.get(element);\n\n\t\tif (elementTasks) {\n\t\t\tAnimationQueue.enqueue(element, task);\n\t\t} else {\n\t\t\tAnimationQueue.run(element, task);\n\t\t}\n\t}\n}\n\nexport default AnimationQueue;\n"],
  "mappings": "aACA,MAAMA,EAAQ,IAAI,QAElB,MAAMC,CAAe,CACpB,WAAW,OAAQ,CAClB,OAAOD,CACR,CAEA,OAAO,QAAQE,EAAsBC,EAAgB,CAC/CH,EAAM,IAAIE,CAAO,GACrBF,EAAM,IAAIE,EAAS,CAAC,CAAC,EAGtBF,EAAM,IAAIE,CAAO,EAAG,KAAKC,CAAI,CAC9B,CAEA,OAAO,IAAID,EAAsBC,EAA+B,CAC/D,OAAKH,EAAM,IAAIE,CAAO,GACrBF,EAAM,IAAIE,EAAS,CAAC,CAAC,EAGfC,EAAK,EAAE,KAAK,IAAM,CACxB,MAAMC,EAAeJ,EAAM,IAAIE,CAAO,EAEtC,GAAIE,EAAc,OAAS,EAC1B,OAAOH,EAAe,IAAIC,EAASE,EAAc,MAAM,CAAE,EAE1DJ,EAAM,OAAOE,CAAO,CACrB,CAAC,CACF,CAEA,OAAO,KAAKA,EAAsBC,EAAgB,CAC5BH,EAAM,IAAIE,CAAO,EAGrCD,EAAe,QAAQC,EAASC,CAAI,EAEpCF,EAAe,IAAIC,EAASC,CAAI,CAElC,CACD,CAEA,eAAeF",
  "names": ["tasks", "AnimationQueue", "element", "task", "elementTasks"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy