{"size": 671, "ext": "js", "max_stars_repo_path": "src/core/framework/Deferred.js", "max_stars_repo_name": "nullice/expresso", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/core/framework/Deferred.js", "max_issues_repo_name": "nullice/expresso", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/core/framework/Deferred.js", "max_forks_repo_name": "nullice/expresso", "max_forks_repo_forks_event_min_datetime": "2021-02-20T06:00:02.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-20T06:00:02.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 19.1714285714, "max_line_length": 70, "alphanum_fraction": 0.6467958271}
﻿
'use strict';

var Promise = require('bluebird');

/**
 * Barebone Deferred implementation.
 *
 * NOTE: for the moment depends on Bluebird supporting the '_progress'
 * method on Promises, which was deprecated in version 3.0.
 */
function Deferred()
{
    var resolve, reject;

    var promise = new Promise(function ()
    {
        resolve = arguments[0];
        reject = arguments[1];
    });

    this.resolve = resolve;
    this.reject = reject;
    this.promise = promise;
    this.notify = function (value)
    {
        promise._progress(value);
    };
};

Deferred.prototype = Object.create(null);
Deferred.constructor = Deferred;

module.exports = Deferred;
