Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag04 committed Feb 23, 2016
2 parents b41ad9f + b5a3728 commit d63d697
Show file tree
Hide file tree
Showing 63 changed files with 768 additions and 817 deletions.
4 changes: 0 additions & 4 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@

# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/Promise.js
.*/node_modules/fbjs/lib/fetch.js
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
.*/node_modules/fbjs/lib/isEmpty.js
.*/node_modules/fbjs/lib/crc32.js
.*/node_modules/fbjs/lib/ErrorUtils.js

# Flow has a built-in definition for the 'react' module which we prefer to use
Expand Down
1 change: 1 addition & 0 deletions Libraries/Interaction/__tests__/InteractionManager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

jest
.autoMockOff()
.mock('ErrorUtils')
.mock('BatchedBridge');

function expectToBeCalledOnce(fn) {
Expand Down
36 changes: 8 additions & 28 deletions Libraries/Promise.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Promise
*
* This module wraps and augments the minimally ES6-compliant Promise
* implementation provided by the promise npm package.
* @flow
*/

'use strict';

global.setImmediate = require('setImmediate');
var Promise = require('promise/setimmediate/es6-extensions');
require('promise/setimmediate/done');
const Promise = require('fbjs/lib/Promise'); // this will require Promise.native.js

if (__DEV__) {
require('promise/setimmediate/rejection-tracking').enable({
allRejections: true,
Expand All @@ -46,12 +34,4 @@ if (__DEV__) {
});
}

/**
* Handle either fulfillment or rejection with the same callback.
*/
Promise.prototype.finally = function(onSettled) {
return this.then(onSettled, onSettled);
};


module.exports = Promise;
Loading

0 comments on commit d63d697

Please sign in to comment.