Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-01-26 10:30:53 +06:00
parent 437170c203
commit c7ca07134a

View File

@ -27,14 +27,14 @@ export { connect }
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export default async () => { export default async () => {
let _token: string | undefined = undefined let _token: string | undefined
let client: Client | undefined let client: Client | undefined
return { return {
function: { function: {
GetClient: async (token: string, endpoint: string): Promise<Client> => { GetClient: async (token: string, endpoint: string): Promise<Client> => {
if (token !== _token && client !== undefined) { if (token !== _token && client !== undefined) {
client.close() await client.close()
client = undefined client = undefined
} }
if (client === undefined) { if (client === undefined) {