Add `name` function to plugin adapter (#463)

Summary:
This presents a human-readable name for a plugin. It’s not yet used
anywhere.

Paired with @decentralion.

Test Plan:
Flow passes.

wchargin-branch: plugin-name
This commit is contained in:
William Chargin 2018-06-29 19:37:00 -07:00 committed by GitHub
parent dd063f5203
commit 728a3cdf37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ export interface Renderer {
}
export interface PluginAdapter {
name(): string;
graph(): Graph;
renderer(): Renderer;
nodePrefix(): NodeAddressT;

View File

@ -26,6 +26,9 @@ class PluginAdapter implements IPluginAdapter {
constructor(graph: Graph) {
this._graph = graph;
}
name() {
return "Git";
}
graph() {
return this._graph;
}

View File

@ -31,6 +31,9 @@ class PluginAdapter implements IPluginAdapter {
this._view = view;
this._graph = graph;
}
name() {
return "GitHub";
}
graph() {
return this._graph;
}