Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for using keyword #397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/discovery/discovery-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,8 @@ export default class DiscoveryService extends AuthenticatedService<DiscoveryServ
}
return endpoint;
}

[Symbol.dispose]() {
return this.destroy();
}
}
7 changes: 3 additions & 4 deletions src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ export default class Driver {
this.logger.debug('Driver has been destroyed.');
}

// TODO: Upgrade project to TS 5.2+
// async [Symbol.asyncDispose]() {
// return this.destroy();
// }
async [Symbol.asyncDispose]() {
return this.destroy();
}
}
4 changes: 4 additions & 0 deletions src/schema/scheme-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@ export default class SchemeClient extends EventEmitter {
public async destroy() {
return;
}

[Symbol.dispose]() {
return this.destroy();
}
}
4 changes: 4 additions & 0 deletions src/table/table-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ export class TableClient extends EventEmitter {
public async destroy(ctx: Context): Promise<void> {
await this.pool.destroy(ctx);
}

async [Symbol.asyncDispose]() {
return this.destroy();
}
}
1 change: 1 addition & 0 deletions tsconfig-cjs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"lib": ["ES2022","ESNext.Disposable"],
"target": "es2017",
"module": "commonjs",
"outDir": "build/cjs"
Expand Down
1 change: 1 addition & 0 deletions tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"lib": ["ES2022","ESNext.Disposable"],
"module": "commonjs",
"outDir": "build/esm",
"target": "esnext"
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"lib": ["ES2022","ESNext.Disposable"],
"target": "es2017",
"module": "commonjs",
"outDir": "build/cjs"
Expand Down
Loading