@dxos/context
Advanced tools
Comparing version 0.1.18 to 0.1.19
@@ -1,1 +0,1 @@ | ||
{"inputs":{"packages/common/context/src/context.ts":{"bytes":11074,"imports":[]},"packages/common/context/src/index.ts":{"bytes":447,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/browser/index.mjs":{"imports":[],"exports":["Context"],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/context.ts":{"bytesInOutput":2570},"packages/common/context/src/index.ts":{"bytesInOutput":0}},"bytes":2634}}} | ||
{"inputs":{"packages/common/context/src/context.ts":{"bytes":11862,"imports":[]},"packages/common/context/src/index.ts":{"bytes":375,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5339},"packages/common/context/dist/lib/browser/index.mjs":{"imports":[],"exports":["Context"],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/context.ts":{"bytesInOutput":2686},"packages/common/context/src/index.ts":{"bytesInOutput":0}},"bytes":2785}}} |
@@ -1,1 +0,1 @@ | ||
{"inputs":{"packages/common/context/src/context.ts":{"bytes":11074,"imports":[]},"packages/common/context/src/index.ts":{"bytes":447,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/node/index.cjs":{"imports":[],"exports":[],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/index.ts":{"bytesInOutput":119},"packages/common/context/src/context.ts":{"bytesInOutput":2611}},"bytes":3714}}} | ||
{"inputs":{"packages/common/context/src/context.ts":{"bytes":11862,"imports":[]},"packages/common/context/src/index.ts":{"bytes":375,"imports":[{"path":"packages/common/context/src/context.ts","kind":"import-statement"}]}},"outputs":{"packages/common/context/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5459},"packages/common/context/dist/lib/node/index.cjs":{"imports":[],"exports":[],"entryPoint":"packages/common/context/src/index.ts","inputs":{"packages/common/context/src/index.ts":{"bytesInOutput":119},"packages/common/context/src/context.ts":{"bytesInOutput":2738}},"bytes":3876}}} |
@@ -17,2 +17,4 @@ export declare type ContextErrorHandler = (error: Error) => void; | ||
* Throwing an error inside the callback will result in the error being logged, but not re-thrown. | ||
* | ||
* NOTE: Will call the callback immediately if the context is already disposed. | ||
*/ | ||
@@ -19,0 +21,0 @@ onDispose(callback: DisposeCallback): void; |
{ | ||
"name": "@dxos/context", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "Async utils.", | ||
@@ -19,4 +19,4 @@ "homepage": "https://dxos.org", | ||
"dependencies": { | ||
"@dxos/log": "0.1.18", | ||
"@dxos/util": "0.1.18" | ||
"@dxos/log": "0.1.19", | ||
"@dxos/util": "0.1.19" | ||
}, | ||
@@ -23,0 +23,0 @@ "publishConfig": { |
@@ -42,6 +42,15 @@ // | ||
* Throwing an error inside the callback will result in the error being logged, but not re-thrown. | ||
* | ||
* NOTE: Will call the callback immediately if the context is already disposed. | ||
*/ | ||
onDispose(callback: DisposeCallback) { | ||
if (this._isDisposed) { | ||
throw new Error('Context is already disposed'); | ||
// Call the callback immediately if the context is already disposed. | ||
void (async () => { | ||
try { | ||
await callback(); | ||
} catch (error: any) { | ||
log.catch(error); | ||
} | ||
})(); | ||
} | ||
@@ -48,0 +57,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27824
18
438
+ Added@dxos/debug@0.1.19(transitive)
+ Added@dxos/keys@0.1.19(transitive)
+ Added@dxos/log@0.1.19(transitive)
+ Added@dxos/node-std@0.1.19(transitive)
+ Added@dxos/util@0.1.19(transitive)
- Removed@dxos/debug@0.1.18(transitive)
- Removed@dxos/keys@0.1.18(transitive)
- Removed@dxos/log@0.1.18(transitive)
- Removed@dxos/node-std@0.1.18(transitive)
- Removed@dxos/util@0.1.18(transitive)
Updated@dxos/log@0.1.19
Updated@dxos/util@0.1.19