Expose isAtom from flipper-plugin

Summary: Required for companion in later diffs

Reviewed By: passy

Differential Revision: D36517737

fbshipit-source-id: ad47ae00cc88f424507284553c7d4eb430691311
This commit is contained in:
Andrey Goncharov
2022-05-23 03:38:23 -07:00
committed by Facebook GitHub Bot
parent 9abce2f48e
commit e40981ee2e
3 changed files with 8 additions and 1 deletions

View File

@@ -57,6 +57,7 @@ test('Correct top level API exposed', () => {
"createState", "createState",
"createTablePlugin", "createTablePlugin",
"getFlipperLib", "getFlipperLib",
"isAtom",
"path", "path",
"produce", "produce",
"renderReactRoot", "renderReactRoot",

View File

@@ -34,7 +34,7 @@ export {
SandyPluginContext as _SandyPluginContext, SandyPluginContext as _SandyPluginContext,
usePlugin, usePlugin,
} from './plugin/PluginContext'; } from './plugin/PluginContext';
export {createState, useValue, Atom} from './state/atom'; export {createState, useValue, Atom, isAtom} from './state/atom';
export {batch} from './state/batch'; export {batch} from './state/batch';
export { export {
FlipperLib, FlipperLib,

View File

@@ -1332,6 +1332,12 @@ someService.on('event', (val) => controllerPromise.resolve(val))
await controllerPromise.promise await controllerPromise.promise
``` ```
### isAtom
Usage: `isAtom(value)`
Checks if value is an [Atom](https://github.com/facebook/flipper/blob/566f7108c9efd8aefc8522af645bd0674fb91b20/desktop/flipper-plugin/src/state/atom.tsx#L30). Returns boolean.
## TestUtils ## TestUtils
The object `TestUtils` as exposed from `flipper-plugin` exposes utilities to write unit tests for Sandy plugins. The object `TestUtils` as exposed from `flipper-plugin` exposes utilities to write unit tests for Sandy plugins.