Summary: Next steps: 1. Refactor it TS for consistency 2. Remove it in favor of tic-tac-toe integration Reviewed By: mweststrate Differential Revision: D36102002 fbshipit-source-id: 7dc930f67bed636159a2ec433d7405ab6ee09f97
41 lines
822 B
TypeScript
41 lines
822 B
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
import {createState, Layout, FlipperPluginInstance} from 'flipper-plugin';
|
|
|
|
export function API(
|
|
pluginInstance: FlipperPluginInstance<typeof devicePlugin>,
|
|
) {
|
|
return {
|
|
increment: pluginInstance.increment,
|
|
};
|
|
}
|
|
|
|
export function devicePlugin() {
|
|
const data = createState(0);
|
|
|
|
const increment = (step: number = 1) => {
|
|
const newVal = data.get() + step;
|
|
data.set(newVal);
|
|
return newVal;
|
|
};
|
|
|
|
return {increment};
|
|
}
|
|
|
|
export function Component() {
|
|
return (
|
|
<Layout.ScrollContainer>
|
|
I am a new shiny headless plugin
|
|
</Layout.ScrollContainer>
|
|
);
|
|
}
|