404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.145.11.153: ~ $
import {
  noop,
  resolve as _resolve
} from '../-internal';

/**
  `RSVP.Promise.resolve` returns a promise that will become resolved with the
  passed `value`. It is shorthand for the following:

  ```javascript
  let promise = new RSVP.Promise(function(resolve, reject){
    resolve(1);
  });

  promise.then(function(value){
    // value === 1
  });
  ```

  Instead of writing the above, your code now simply becomes the following:

  ```javascript
  let promise = RSVP.Promise.resolve(1);

  promise.then(function(value){
    // value === 1
  });
  ```

  @method resolve
  @static
  @param {*} object value that the returned promise will be resolved with
  @param {String} label optional string for identifying the returned promise.
  Useful for tooling.
  @return {Promise} a promise that will become fulfilled with the given
  `value`
*/
export default function resolve(object, label) {
  /*jshint validthis:true */
  let Constructor = this;

  if (object && typeof object === 'object' && object.constructor === Constructor) {
    return object;
  }

  let promise = new Constructor(noop, label);
  _resolve(promise, object);
  return promise;
}

Filemanager

Name Type Size Permission Actions
all.js File 1.78 KB 0644
race.js File 2.48 KB 0644
reject.js File 1.21 KB 0644
resolve.js File 1.13 KB 0644