UNPKG

casc-cesium

Version:

Vue 3.x components for CesiumJS.

1 lines 1.7 kB
{"version":3,"file":"defer.mjs","sources":["../../../../packages/utils/defer.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2022-04-06 16:00:16\n * @LastEditTime: 2022-04-06 16:00:25\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\utils\\defer.ts\n */\n\n/**\n * A function used to resolve a promise upon completion .\n * @callback defer.resolve\n *\n * @param {*} value The resulting value.\n */\n\n/**\n * A function used to reject a promise upon failure.\n * @callback defer.reject\n *\n * @param {*} error The error.\n */\n\n/**\n * An object which contains a promise object, and functions to resolve or reject the promise.\n *\n * @typedef {Object} defer.deferred\n * @property {defer.resolve} resolve Resolves the promise when called.\n * @property {defer.reject} reject Rejects the promise when called.\n * @property {Promise} promise Promise object.\n */\n\n/**\n * Creates a deferred object, containing a promise object, and functions to resolve or reject the promise.\n * @returns {defer.deferred}\n * @private\n */\nfunction defer() {\n let resolve\n let reject\n const promise = new Promise(function (res, rej) {\n resolve = res\n reject = rej\n })\n\n return {\n resolve: resolve,\n reject: reject,\n promise: promise\n }\n}\n\nexport default defer\n"],"names":[],"mappings":"AAAA,SAAS,KAAK,GAAG;AACjB,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE;AACjD,IAAI,OAAO,GAAG,GAAG,CAAC;AAClB,IAAI,MAAM,GAAG,GAAG,CAAC;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;"}