linx-simulator2/node_modules/config/defer.js
2019-09-18 11:11:16 +03:00

15 lines
539 B
JavaScript

// Create a deferredConfig prototype so that we can check for it when reviewing the configs later.
function DeferredConfig () {
}
DeferredConfig.prototype.resolve = function (config, original) {};
// Accept a function that we'll use to resolve this value later and return a 'deferred' configuration value to resolve it later.
function deferConfig (func) {
var obj = Object.create(DeferredConfig.prototype);
obj.resolve = func;
return obj;
}
module.exports.deferConfig = deferConfig;
module.exports.DeferredConfig = DeferredConfig;