chore: reword the changeset

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-06-03 11:10:04 +02:00
parent 90a505a77f
commit 1ff7d88c57
+28 -1
View File
@@ -2,4 +2,31 @@
'@backstage/plugin-tech-radar': minor
---
Migrating the Tech Radar to support using `ApiRefs` to go fetch data
Migrating the Tech Radar to support using `ApiRefs` to load custom data.
If you had a `getData` function, you'll now need to encapsulate that logic in a class that can override the `techRadarApiRef`.
```ts
// app/src/lib/MyClient.ts
import {
TechRadarApi,
TechRadarLoaderResponse,
} from '@backstage/plugin-tech-radar';
class MyOwnClient implements TechRadarApi {
async load(): Promise<TechRadarLoaderResponse> {
// here's where you would put you logic to load the response that was previously passed into getData
}
}
// app/src/apis.ts
import { MyOwnClient } from './lib/MyClient';
import { techRadarApiRef } from '@backstage/plugin-tech-radar';
export const apis: AnyApiFactory[] = [
/*
...
*/
createApiFactory(techRadarApiRef, new MyOwnClient()),
];
```