v2.3.0
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartcontext',
|
||||
version: '2.2.1',
|
||||
version: '2.3.0',
|
||||
description: 'A module providing advanced asynchronous context management to enrich logs with context and manage scope effectively in Node.js applications.'
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ import * as plugins from './plugins.js';
|
||||
import { AsyncStore } from './classes.asyncstore.js';
|
||||
|
||||
export class AsyncContext {
|
||||
private _context = new plugins.simpleAsyncContext.AsyncContext.Variable<AsyncStore>();
|
||||
private _context = new plugins.AsyncLocalStorage<AsyncStore>();
|
||||
private _store = new AsyncStore();
|
||||
get store() {
|
||||
return this._context.get() || this._store;
|
||||
return this._context.getStore() || this._store;
|
||||
}
|
||||
set store(value: AsyncStore) {
|
||||
this._store = value;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// third party scope
|
||||
import simpleAsyncContext from 'simple-async-context';
|
||||
import { AsyncLocalStorage } from 'node:async_hooks';
|
||||
|
||||
export { simpleAsyncContext };
|
||||
export { AsyncLocalStorage };
|
||||
Reference in New Issue
Block a user