From e639055fc455715e9d98a394a6723a7d710a1ad0 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Mon, 23 May 2022 03:38:23 -0700 Subject: [PATCH] Enable headless mode for the tic-tac-toe plugin Reviewed By: passy Differential Revision: D36517761 fbshipit-source-id: 0db933d825434da90e814054db531038ea93d610 --- desktop/plugins/public/rn-tic-tac-toe/index.tsx | 9 +++++++++ desktop/plugins/public/rn-tic-tac-toe/package.json | 1 + 2 files changed, 10 insertions(+) diff --git a/desktop/plugins/public/rn-tic-tac-toe/index.tsx b/desktop/plugins/public/rn-tic-tac-toe/index.tsx index cb54a8550..e7359d935 100644 --- a/desktop/plugins/public/rn-tic-tac-toe/index.tsx +++ b/desktop/plugins/public/rn-tic-tac-toe/index.tsx @@ -18,6 +18,7 @@ import { styled, theme, Layout, + FlipperPluginInstance, } from 'flipper-plugin'; type Player = ' ' | 'X' | 'O'; @@ -120,6 +121,14 @@ export const plugin = (client: PluginClient) => { }; }; +export const API = (pluginInstance: FlipperPluginInstance) => { + return { + makeMove: pluginInstance.makeMove, + reset: pluginInstance.reset, + state: pluginInstance.state, + }; +}; + const desktopPlayer = 'O'; export const Component = () => { diff --git a/desktop/plugins/public/rn-tic-tac-toe/package.json b/desktop/plugins/public/rn-tic-tac-toe/package.json index 9ca950a05..ef13ffe77 100644 --- a/desktop/plugins/public/rn-tic-tac-toe/package.json +++ b/desktop/plugins/public/rn-tic-tac-toe/package.json @@ -5,6 +5,7 @@ "version": "0.0.0", "main": "dist/bundle.js", "flipperBundlerEntry": "index.tsx", + "headless": true, "license": "MIT", "keywords": [ "flipper-plugin"