mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 18:44:25 +00:00
Add fbjs definitions to flow config
Reviewed By: zertosh Differential Revision: D4291805 fbshipit-source-id: 3dcb8ffe6132bd04a3048edae64e9d273c2dcae4
This commit is contained in:
parent
b203343b81
commit
6786cbd3e4
16
flow/fbjs.js
Normal file
16
flow/fbjs.js
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
declare module 'fbjs/lib/invariant' {
|
||||
declare function exports<T>(condition: any, message: string, ...args: Array<any>): void;
|
||||
}
|
||||
|
||||
declare module 'fbjs/lib/nullthrows' {
|
||||
declare function exports<T>(value: ?T): T;
|
||||
}
|
@ -197,7 +197,7 @@ class Device {
|
||||
|
||||
_handleWrappedEvent(event: WrappedEvent) {
|
||||
const payload = nullthrows(event.payload);
|
||||
const socket = this._connections.get(payload.pageId);
|
||||
const socket = this._connections.get(nullthrows(payload.pageId));
|
||||
if (!socket) {
|
||||
console.error('Invalid pageId from device:', payload.pageId);
|
||||
return;
|
||||
|
@ -139,5 +139,5 @@ exports.forOptimization =
|
||||
collectDependencies(
|
||||
ast,
|
||||
new ProdReplacement(names),
|
||||
dependencyMapName && types.identifier(dependencyMapName),
|
||||
dependencyMapName ? types.identifier(dependencyMapName) : undefined,
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user