Merge pull request #12406 from joosthofman/tech-radar/update-external-source-docs

Update tech radar docs on using an external datasource
This commit is contained in:
Patrik Oldsberg
2022-07-06 13:10:24 +02:00
committed by GitHub
2 changed files with 16 additions and 3 deletions
+11 -3
View File
@@ -90,9 +90,17 @@ export class MyOwnClient implements TechRadarApi {
const data = await fetch('https://mydata.json').then(res => res.json());
// maybe you'll need to do some data transformation here to make it look like TechRadarLoaderResponse
return data;
// For example, this converts the timeline dates into date objects
return {
...data,
entries: data.entries.map(entry => ({
...entry,
timeline: entry.timeline.map(timeline => ({
...timeline,
date: new Date(timeline.date),
})),
})),
};
}
}