UNPKG

740 BJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 * @flow
9 */
10
11'use strict';
12
13require('Promise'); // make sure the default rejection handler is installed
14/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
15 * found when Flow v0.54 was deployed. To see the error delete this comment and
16 * run Flow. */
17const rejectionTracking = require('promise/setimmediate/rejection-tracking');
18
19module.exports = () => {
20 rejectionTracking.enable({
21 allRejections: true,
22 onUnhandled: (id, error) => {
23 console.error(error);
24 },
25 onHandled: () => {},
26 });
27};