universe-code 0.0.69 → 0.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
1
  export { IdbService } from './indexdb/services/idbService.mjs';
2
+ export { IDB_CONFIG } from './indexdb/services/idb.config.mjs';
@@ -1,10 +1,10 @@
1
- // idb.config.mjs
1
+ // idb.config.ts
2
2
  import { InjectionToken } from '@angular/core';
3
3
 
4
- export const IDB_CONFIG = new InjectionToken('IDB_CONFIG');
5
-
6
4
  /** @typedef {Object} IdbConfig
7
5
  * @property {string} dbName
8
6
  * @property {number} version
9
7
  * @property {string} storeName
10
8
  */
9
+
10
+ export const IDB_CONFIG = new InjectionToken<IdbConfig>('IDB_CONFIG');
@@ -1,13 +1,15 @@
1
- import { DBManager, DB } from "universe-code";
2
- import { IDB_CONFIG } from "./idb.config.mjs";
1
+ // idbService.mjs
2
+ import { DBManager, DB } from 'universe-code';
3
+ import { inject } from '@angular/core';
4
+ import { IDB_CONFIG } from './idb.config.mjs';
3
5
 
4
6
  export class IdbService {
5
7
  db = null;
6
8
  manager = null;
7
- isBrowser = typeof window !== "undefined"; // Check if running in browser
8
- options = IDB_CONFIG;
9
+ options = inject(IDB_CONFIG); // <-- Angular will inject the config
10
+ isBrowser = typeof window !== 'undefined';
9
11
 
10
- constructor() { }
12
+ constructor() {}
11
13
 
12
14
  async connect() {
13
15
  if (!this.isBrowser) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universe-code",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "description": "Universal utility functions for all JS frameworks",
5
5
  "license": "ISC",
6
6
  "type": "module",