From dc8246d56e406e34cf2d5eee3729b396e3673db8 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Mon, 26 Nov 2018 06:24:05 -0800 Subject: [PATCH] Stop using Promise from fbjs Summary: This module simply forwards to the `promise` module. I inlined the code to remove the dependency. Reviewed By: yungsters Differential Revision: D13137980 fbshipit-source-id: e3d6208068911711fc5f5378f2d5bb6ac38f2eb2 --- Libraries/Promise.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Libraries/Promise.js b/Libraries/Promise.js index 0a2776215..960834cd5 100644 --- a/Libraries/Promise.js +++ b/Libraries/Promise.js @@ -10,10 +10,12 @@ 'use strict'; -/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error - * found when Flow v0.54 was deployed. To see the error delete this comment and - * run Flow. */ -const Promise = require('fbjs/lib/Promise.native'); +const Promise = require('promise/setimmediate/es6-extensions'); +require('promise/setimmediate/done'); + +Promise.prototype.finally = function(onSettled) { + return this.then(onSettled, onSettled); +}; if (__DEV__) { /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an