Promise.native.js.flow 630 B

12345678910111213141516171819202122232425
  1. /**
  2. *
  3. * Copyright (c) 2013-present, Facebook, Inc.
  4. *
  5. * This source code is licensed under the MIT license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. *
  8. * This module wraps and augments the minimally ES6-compliant Promise
  9. * implementation provided by the promise npm package.
  10. *
  11. */
  12. 'use strict';
  13. var Promise = require('promise/setimmediate/es6-extensions');
  14. require('promise/setimmediate/done');
  15. /**
  16. * Handle either fulfillment or rejection with the same callback.
  17. */
  18. Promise.prototype.finally = function (onSettled) {
  19. return this.then(onSettled, onSettled);
  20. };
  21. module.exports = Promise;