Remove instanceof checks
Summary: Replaced `instanceof` checks with `isSandyPlugin` utility. That is cleaner to read and makes it easier to find places where we make exceptions for Sandy plugins Reviewed By: jknoxville Differential Revision: D22206707 fbshipit-source-id: b44a1b585424f3b9bf0d7ce200c34107f03ed55e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1dc9e899b8
commit
04a29315e2
@@ -37,6 +37,12 @@ export type ClientPluginDefinition =
|
||||
export type ClientPluginMap = Map<string, ClientPluginDefinition>;
|
||||
export type DevicePluginMap = Map<string, DevicePluginDefinition>;
|
||||
|
||||
export function isSandyPlugin(
|
||||
plugin?: PluginDefinition,
|
||||
): plugin is SandyPluginDefinition {
|
||||
return plugin instanceof SandyPluginDefinition;
|
||||
}
|
||||
|
||||
// This function is intended to be called from outside of the plugin.
|
||||
// If you want to `call` from the plugin use, this.client.call
|
||||
export function callClient(
|
||||
|
||||
Reference in New Issue
Block a user