feat: add createNetworkClient helper

This commit is contained in:
Derrick Hammer 2023-10-09 00:15:47 -04:00
parent 7730140b26
commit 6ecaf16d4e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 9 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import defer from "p-defer"; import defer from "p-defer";
export { defer }; export { defer };
export { log, logErr } from "./log.js"; export { log, logErr } from "./log.js";
@ -11,3 +12,11 @@ export { Client, factory } from "./client.js";
import NetworkClient from "./clients/network.js"; import NetworkClient from "./clients/network.js";
export { NetworkClient }; export { NetworkClient };
import { factory } from "./client.js";
class GenericNetworkClient extends NetworkClient {}
export function createNetworkClient(module: string): GenericNetworkClient {
return factory<GenericNetworkClient>(GenericNetworkClient, module)();
}