chore: extract json-api from core

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2023-05-04 12:51:11 +03:00
1 parent f1f2634490
commit 04a23fc4f9
20 files changed
+164 -55

No files matched your search

@@ -3,14 +3,13 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import type { RequestInit, Response } from "@k8slens/node-fetch";
import fetch from "@k8slens/node-fetch";
export type Fetch = (url: string, init?: RequestInit) => Promise<Response>;
export type Fetch = typeof fetch;
const fetchInjectable = getInjectable({
id: "fetch",
instantiate: () => fetch as Fetch,
instantiate: () => fetch,
causesSideEffects: true,
});