feat(core): fail-safe global data fetching (#7083)

This commit is contained in:
Joshua Chen 2022-04-08 17:08:22 +08:00 committed by GitHub
parent 9145ae88cc
commit 171927342f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 51 additions and 26 deletions

View file

@ -544,7 +544,11 @@ This is the most convenient hook to access plugin global data and should be used
`pluginId` is optional if you don't use multi-instance plugins.
```ts
function usePluginData(pluginName: string, pluginId?: string);
function usePluginData(
pluginName: string,
pluginId?: string,
options?: {failfast?: boolean},
);
```
Usage example:
@ -567,7 +571,10 @@ const MyComponent = () => {
Access global data created by a specific plugin. Given a plugin name, it returns the data of all the plugins instances of that name, by plugin id.
```ts
useAllPluginInstancesData(pluginName: string)
function useAllPluginInstancesData(
pluginName: string,
options?: {failfast?: boolean},
);
```
Usage example: