From ccf72791d6d772cc97f33578cbcffbc24851193d Mon Sep 17 00:00:00 2001 From: aparzi Date: Tue, 31 Dec 2024 16:39:49 +0100 Subject: [PATCH 1/2] remove database connection closed log in decorator class --- package.json | 2 +- projects/ngx-indexed-db/package.json | 2 +- projects/ngx-indexed-db/src/lib/decorators.ts | 80 ++++++++++++++++++- 3 files changed, 81 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f07356b..812d7bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-indexed-db", - "version": "19.3.0", + "version": "19.3.1", "files": [ "dist/ngx-indexed-db/**/*" ], diff --git a/projects/ngx-indexed-db/package.json b/projects/ngx-indexed-db/package.json index 0fecc65..7dc60f3 100644 --- a/projects/ngx-indexed-db/package.json +++ b/projects/ngx-indexed-db/package.json @@ -2,7 +2,7 @@ "name": "ngx-indexed-db", "author": "Charles Assunção", "description": "Angular wrapper to IndexedDB database.", - "version": "19.3.0", + "version": "19.3.1", "license": "ISC", "private": false, "keywords": [ diff --git a/projects/ngx-indexed-db/src/lib/decorators.ts b/projects/ngx-indexed-db/src/lib/decorators.ts index 24ebfb3..6c9004d 100644 --- a/projects/ngx-indexed-db/src/lib/decorators.ts +++ b/projects/ngx-indexed-db/src/lib/decorators.ts @@ -13,11 +13,89 @@ export function CloseDbConnection(): MethodDecorator { finalize(async () => { const promises = openedDatabases.map(async (db: IDBDatabase) => { await closeDatabase(db); - console.log('Database connection closed: ', db.name); }); await Promise.all(promises); openedDatabases.length = 0; }) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); } return result; From ade0772c9ba7acdc81c78b7bfb9813cbd642296f Mon Sep 17 00:00:00 2001 From: aparzi Date: Tue, 31 Dec 2024 16:43:47 +0100 Subject: [PATCH 2/2] fix error whitespace --- projects/ngx-indexed-db/src/lib/decorators.ts | 88 +------------------ 1 file changed, 4 insertions(+), 84 deletions(-) diff --git a/projects/ngx-indexed-db/src/lib/decorators.ts b/projects/ngx-indexed-db/src/lib/decorators.ts index 6c9004d..c3876b9 100644 --- a/projects/ngx-indexed-db/src/lib/decorators.ts +++ b/projects/ngx-indexed-db/src/lib/decorators.ts @@ -1,6 +1,6 @@ -import { Observable } from 'rxjs'; -import { finalize } from 'rxjs/operators'; -import { closeDatabase, openedDatabases } from './ngx-indexed-db'; +import {Observable} from 'rxjs'; +import {finalize} from 'rxjs/operators'; +import {closeDatabase, openedDatabases} from './ngx-indexed-db'; export function CloseDbConnection(): MethodDecorator { return function (_target: object, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor { @@ -16,87 +16,7 @@ export function CloseDbConnection(): MethodDecorator { }); await Promise.all(promises); openedDatabases.length = 0; - }) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); + })); } return result; };