Add fbjs definitions to flow config

Reviewed By: zertosh

Differential Revision: D4291805

fbshipit-source-id: 3dcb8ffe6132bd04a3048edae64e9d273c2dcae4
This commit is contained in:
David Aurelio
2016-12-12 11:37:18 +00:00
committed by Martin Konicek
parent 7d2a461c2a
commit 3d31c411e4
3 changed files with 18 additions and 2 deletions
+16
View 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;
}
+1 -1
View File
@@ -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,
);