Enable headless mode for the tic-tac-toe plugin
Reviewed By: passy Differential Revision: D36517761 fbshipit-source-id: 0db933d825434da90e814054db531038ea93d610
This commit is contained in:
committed by
Facebook GitHub Bot
parent
17b2e9d375
commit
e639055fc4
@@ -18,6 +18,7 @@ import {
|
|||||||
styled,
|
styled,
|
||||||
theme,
|
theme,
|
||||||
Layout,
|
Layout,
|
||||||
|
FlipperPluginInstance,
|
||||||
} from 'flipper-plugin';
|
} from 'flipper-plugin';
|
||||||
|
|
||||||
type Player = ' ' | 'X' | 'O';
|
type Player = ' ' | 'X' | 'O';
|
||||||
@@ -120,6 +121,14 @@ export const plugin = (client: PluginClient<Events, Methods>) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const API = (pluginInstance: FlipperPluginInstance<typeof plugin>) => {
|
||||||
|
return {
|
||||||
|
makeMove: pluginInstance.makeMove,
|
||||||
|
reset: pluginInstance.reset,
|
||||||
|
state: pluginInstance.state,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const desktopPlayer = 'O';
|
const desktopPlayer = 'O';
|
||||||
|
|
||||||
export const Component = () => {
|
export const Component = () => {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"main": "dist/bundle.js",
|
"main": "dist/bundle.js",
|
||||||
"flipperBundlerEntry": "index.tsx",
|
"flipperBundlerEntry": "index.tsx",
|
||||||
|
"headless": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"flipper-plugin"
|
"flipper-plugin"
|
||||||
|
|||||||
Reference in New Issue
Block a user