@dxos/async
Advanced tools
Comparing version 0.6.13 to 0.6.14-main.7bd9c89
@@ -1,1 +0,1 @@ | ||
{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":36125,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15525,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"@dxos/node-std/stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83110},"packages/common/async/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7783},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":935},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34414}}} | ||
{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":37154,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15529,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"@dxos/node-std/stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83817},"packages/common/async/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7861},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":935},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34492}}} |
@@ -1,1 +0,1 @@ | ||
{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":36125,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15525,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83110},"packages/common/async/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7783},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":925},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34404}}} | ||
{"inputs":{"packages/common/async/src/callback.ts":{"bytes":1594,"imports":[],"format":"esm"},"packages/common/async/src/chain.ts":{"bytes":1701,"imports":[],"format":"esm"},"packages/common/async/src/debounce.ts":{"bytes":1275,"imports":[],"format":"esm"},"packages/common/async/src/errors.ts":{"bytes":3008,"imports":[],"format":"esm"},"packages/common/async/src/timeout.ts":{"bytes":7907,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"packages/common/async/src/event-emitter.ts":{"bytes":4236,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/events.ts":{"bytes":37154,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/latch.ts":{"bytes":4484,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/trigger.ts":{"bytes":9868,"imports":[{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/observable.ts":{"bytes":18063,"imports":[{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/observable-value.ts":{"bytes":6622,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/mutex.ts":{"bytes":12860,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/sink.ts":{"bytes":2055,"imports":[{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/stream-to-array.ts":{"bytes":5040,"imports":[],"format":"esm"},"packages/common/async/src/timer.ts":{"bytes":6062,"imports":[{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"}],"format":"esm"},"packages/common/async/src/testing.ts":{"bytes":4756,"imports":[{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/types.ts":{"bytes":517,"imports":[],"format":"esm"},"packages/common/async/src/until.ts":{"bytes":4408,"imports":[],"format":"esm"},"packages/common/async/src/track-leaks.ts":{"bytes":8583,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/common/async/src/task-scheduling.ts":{"bytes":15529,"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"}],"format":"esm"},"packages/common/async/src/test-stream.ts":{"bytes":5087,"imports":[{"path":"node:stream","kind":"import-statement","external":true},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"}],"format":"esm"},"packages/common/async/src/update-scheduler.ts":{"bytes":9920,"imports":[{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"}],"format":"esm"},"packages/common/async/src/index.ts":{"bytes":2419,"imports":[{"path":"packages/common/async/src/callback.ts","kind":"import-statement","original":"./callback"},{"path":"packages/common/async/src/chain.ts","kind":"import-statement","original":"./chain"},{"path":"packages/common/async/src/debounce.ts","kind":"import-statement","original":"./debounce"},{"path":"packages/common/async/src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"packages/common/async/src/event-emitter.ts","kind":"import-statement","original":"./event-emitter"},{"path":"packages/common/async/src/events.ts","kind":"import-statement","original":"./events"},{"path":"packages/common/async/src/latch.ts","kind":"import-statement","original":"./latch"},{"path":"packages/common/async/src/observable.ts","kind":"import-statement","original":"./observable"},{"path":"packages/common/async/src/observable-value.ts","kind":"import-statement","original":"./observable-value"},{"path":"packages/common/async/src/mutex.ts","kind":"import-statement","original":"./mutex"},{"path":"packages/common/async/src/sink.ts","kind":"import-statement","original":"./sink"},{"path":"packages/common/async/src/stream-to-array.ts","kind":"import-statement","original":"./stream-to-array"},{"path":"packages/common/async/src/timeout.ts","kind":"import-statement","original":"./timeout"},{"path":"packages/common/async/src/timer.ts","kind":"import-statement","original":"./timer"},{"path":"packages/common/async/src/testing.ts","kind":"import-statement","original":"./testing"},{"path":"packages/common/async/src/trigger.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/common/async/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/common/async/src/until.ts","kind":"import-statement","original":"./until"},{"path":"packages/common/async/src/task-scheduling.ts","kind":"import-statement","original":"./task-scheduling"},{"path":"packages/common/async/src/test-stream.ts","kind":"import-statement","original":"./test-stream"},{"path":"packages/common/async/src/track-leaks.ts","kind":"import-statement","original":"./track-leaks"},{"path":"packages/common/async/src/update-scheduler.ts","kind":"import-statement","original":"./update-scheduler"}],"format":"esm"}},"outputs":{"packages/common/async/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":83817},"packages/common/async/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"zen-observable","kind":"import-statement","external":true},{"path":"zen-push","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:stream","kind":"import-statement","external":true}],"exports":["CancellableObservableProvider","DeferredTask","Event","EventSubscriptions","MulticastObservable","Mutex","MutexGuard","Observable","ObservableProvider","PushStream","TestStream","TimeoutError","Timer","Trigger","TriggerState","UpdateScheduler","addListener","asyncChain","asyncReturn","asyncTimeout","createPromiseFromCallback","debounce","dumpLeaks","latch","observableError","onEvent","runInContext","runInContextAsync","scheduleExponentialBackoffTaskInterval","scheduleMicroTask","scheduleTask","scheduleTaskInterval","sink","sleep","sleepWithContext","streamToArray","synchronized","toError","trackLeaks","trackResource","trigger","unrefTimeout","until","untilError","untilPromise","waitForCondition","waitForEvent"],"entryPoint":"packages/common/async/src/index.ts","inputs":{"packages/common/async/src/callback.ts":{"bytesInOutput":191},"packages/common/async/src/index.ts":{"bytesInOutput":0},"packages/common/async/src/chain.ts":{"bytesInOutput":219},"packages/common/async/src/debounce.ts":{"bytesInOutput":144},"packages/common/async/src/errors.ts":{"bytesInOutput":473},"packages/common/async/src/timeout.ts":{"bytesInOutput":1487},"packages/common/async/src/event-emitter.ts":{"bytesInOutput":694},"packages/common/async/src/events.ts":{"bytesInOutput":7861},"packages/common/async/src/latch.ts":{"bytesInOutput":987},"packages/common/async/src/observable.ts":{"bytesInOutput":3695},"packages/common/async/src/trigger.ts":{"bytesInOutput":1835},"packages/common/async/src/observable-value.ts":{"bytesInOutput":975},"packages/common/async/src/mutex.ts":{"bytesInOutput":2444},"packages/common/async/src/sink.ts":{"bytesInOutput":285},"packages/common/async/src/stream-to-array.ts":{"bytesInOutput":967},"packages/common/async/src/timer.ts":{"bytesInOutput":1054},"packages/common/async/src/testing.ts":{"bytesInOutput":587},"packages/common/async/src/until.ts":{"bytesInOutput":760},"packages/common/async/src/task-scheduling.ts":{"bytesInOutput":3090},"packages/common/async/src/track-leaks.ts":{"bytesInOutput":2149},"packages/common/async/src/test-stream.ts":{"bytesInOutput":925},"packages/common/async/src/update-scheduler.ts":{"bytesInOutput":1855}},"bytes":34482}}} |
@@ -6,3 +6,3 @@ import { type EventEmitter } from 'node:events'; | ||
*/ | ||
export declare const onEvent: (eventEmitter: EventEmitter, eventName: string, callback: (args: any) => void) => () => EventEmitter; | ||
export declare const onEvent: (eventEmitter: EventEmitter, eventName: string, callback: (args: any) => void) => () => EventEmitter<[never]>; | ||
/** | ||
@@ -12,3 +12,3 @@ * @deprecated | ||
export declare const addListener: (eventEmitter: EventEmitter, eventName: string, callback: () => void) => { | ||
remove: () => EventEmitter; | ||
remove: () => EventEmitter<[never]>; | ||
}; | ||
@@ -15,0 +15,0 @@ /** |
@@ -43,3 +43,3 @@ import { Context } from '@dxos/context'; | ||
* 2. User can explicitly define event visibility (public, protected, private). | ||
* 3. Havings events as class fields allows the compiler to check for correct event usage. | ||
* 3. Having events as class fields allows the compiler to check for correct event usage. | ||
* 4. User can type the data that event will be emitting. | ||
@@ -51,2 +51,5 @@ * 5. Uses composition instead of inheritance. | ||
export declare class Event<T = void> implements ReadOnlyEvent<T> { | ||
/** | ||
* Wrap objects that have on/off style event emitters. | ||
*/ | ||
static wrap<T>(emitter: EventEmitterLike, eventName: string): Event<T>; | ||
@@ -161,9 +164,11 @@ private readonly _listeners; | ||
/** | ||
* Registers an event listener. | ||
* Register an event listener. | ||
* If provided callback was already registered as once-listener, it is made permanent. | ||
* | ||
* @param callback | ||
* @param options.weak If true, the callback will be weakly referenced and will be garbage collected if no other references to it exist. | ||
* @returns function that unsubscribes this event listener | ||
*/ | ||
on(callback: (data: T) => void): UnsubscribeCallback; | ||
on(ctx: Context, callback: (data: T) => void, options?: ListenerOptions): UnsubscribeCallback; | ||
/** | ||
@@ -205,4 +210,11 @@ * Unsubscribes this callback from new events. Includes persistent and once-listeners. | ||
discardParameter(): Event<void>; | ||
/** | ||
* Triggers an event with at least `timeout` milliseconds between each event. | ||
* If the event is triggered more often, the event is delayed until the timeout is reached. | ||
* If event is emitted for the first time or event wasn't fired for `timeout` milliseconds, | ||
* the event is emitted after `timeout / 8` ms. | ||
*/ | ||
debounce(timeout?: number): Event<void>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=events.d.ts.map |
{ | ||
"name": "@dxos/async", | ||
"version": "0.6.13", | ||
"version": "0.6.14-main.7bd9c89", | ||
"description": "Async utilities.", | ||
@@ -13,3 +13,4 @@ "homepage": "https://dxos.org", | ||
"node": { | ||
"default": "./dist/lib/node/index.cjs" | ||
"require": "./dist/lib/node/index.cjs", | ||
"default": "./dist/lib/node-esm/index.mjs" | ||
}, | ||
@@ -30,8 +31,8 @@ "types": "./dist/types/src/index.d.ts" | ||
"zen-push": "^0.3.1", | ||
"@dxos/context": "0.6.13", | ||
"@dxos/log": "0.6.13", | ||
"@dxos/util": "0.6.13", | ||
"@dxos/debug": "0.6.13", | ||
"@dxos/node-std": "0.6.13", | ||
"@dxos/invariant": "0.6.13" | ||
"@dxos/context": "0.6.14-main.7bd9c89", | ||
"@dxos/debug": "0.6.14-main.7bd9c89", | ||
"@dxos/node-std": "0.6.14-main.7bd9c89", | ||
"@dxos/invariant": "0.6.14-main.7bd9c89", | ||
"@dxos/log": "0.6.14-main.7bd9c89", | ||
"@dxos/util": "0.6.14-main.7bd9c89" | ||
}, | ||
@@ -38,0 +39,0 @@ "devDependencies": { |
@@ -5,7 +5,5 @@ // | ||
import { expect } from 'chai'; | ||
import { EventEmitter } from 'node:events'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { describe, test } from '@dxos/test'; | ||
import { onEvent, waitForEvent } from './event-emitter'; | ||
@@ -12,0 +10,0 @@ import { latch } from './latch'; |
@@ -5,8 +5,7 @@ // | ||
import { expect } from 'chai'; | ||
import { setFlagsFromString } from 'node:v8'; | ||
import { runInNewContext } from 'node:vm'; | ||
// import { setFlagsFromString } from 'node:v8'; | ||
// import { runInNewContext } from 'node:vm'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { Context } from '@dxos/context'; | ||
import { describe, test } from '@dxos/test'; | ||
@@ -94,26 +93,26 @@ import { Event } from './events'; | ||
test.skip('weak', async () => { | ||
setFlagsFromString('--expose_gc'); | ||
const gc = runInNewContext('gc'); // nocommit | ||
// test.skip('weak', async () => { | ||
// setFlagsFromString('--expose_gc'); | ||
// const gc = runInNewContext('gc'); // nocommit | ||
let called = 0; | ||
let callback: (() => void) | null = () => { | ||
called++; | ||
}; | ||
// let called = 0; | ||
// let callback: (() => void) | null = () => { | ||
// called++; | ||
// }; | ||
const event = new Event(); | ||
event.on(new Context(), callback, { weak: true }); | ||
// const event = new Event(); | ||
// event.on(new Context(), callback, { weak: true }); | ||
event.emit(); | ||
expect(called).to.equal(1); | ||
// event.emit(); | ||
// expect(called).to.equal(1); | ||
callback = null; | ||
while (event.listenerCount() > 0) { | ||
gc(); | ||
await sleep(5); | ||
} | ||
// callback = null; | ||
// while (event.listenerCount() > 0) { | ||
// gc(); | ||
// await sleep(5); | ||
// } | ||
event.emit(); | ||
expect(called).to.equal(1); | ||
}); | ||
// event.emit(); | ||
// expect(called).to.equal(1); | ||
// }); | ||
}); |
@@ -68,3 +68,3 @@ // | ||
* 2. User can explicitly define event visibility (public, protected, private). | ||
* 3. Havings events as class fields allows the compiler to check for correct event usage. | ||
* 3. Having events as class fields allows the compiler to check for correct event usage. | ||
* 4. User can type the data that event will be emitting. | ||
@@ -77,2 +77,5 @@ * 5. Uses composition instead of inheritance. | ||
export class Event<T = void> implements ReadOnlyEvent<T> { | ||
/** | ||
* Wrap objects that have on/off style event emitters. | ||
*/ | ||
static wrap<T>(emitter: EventEmitterLike, eventName: string): Event<T> { | ||
@@ -264,3 +267,3 @@ const event = new Event<T>(); | ||
*/ | ||
// TODO(burdon): Provide function. | ||
// TODO(burdon): Factor out generic function. | ||
debounce(timeout = 0) { | ||
@@ -349,9 +352,11 @@ let firing: NodeJS.Timeout | undefined; | ||
/** | ||
* Registers an event listener. | ||
* Register an event listener. | ||
* If provided callback was already registered as once-listener, it is made permanent. | ||
* | ||
* @param callback | ||
* @param options.weak If true, the callback will be weakly referenced and will be garbage collected if no other references to it exist. | ||
* @returns function that unsubscribes this event listener | ||
*/ | ||
on(callback: (data: T) => void): UnsubscribeCallback; | ||
on(ctx: Context, callback: (data: T) => void, options?: ListenerOptions): UnsubscribeCallback; | ||
@@ -399,2 +404,10 @@ /** | ||
discardParameter(): Event<void>; | ||
/** | ||
* Triggers an event with at least `timeout` milliseconds between each event. | ||
* If the event is triggered more often, the event is delayed until the timeout is reached. | ||
* If event is emitted for the first time or event wasn't fired for `timeout` milliseconds, | ||
* the event is emitted after `timeout / 8` ms. | ||
*/ | ||
debounce(timeout?: number): Event<void>; | ||
} | ||
@@ -401,0 +414,0 @@ |
@@ -5,6 +5,5 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { expectToThrow } from '@dxos/debug'; | ||
import { describe, test } from '@dxos/test'; | ||
@@ -143,3 +142,3 @@ import { Mutex, synchronized } from './mutex'; | ||
expect(error!.stack!.includes('callmutex')).to.be.true; | ||
}).skipEnvironments('webkit'); | ||
}); // .skipEnvironments('webkit'); | ||
@@ -146,0 +145,0 @@ test('works with explicit resource management syntax', async () => { |
@@ -5,6 +5,4 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { describe, test } from '@dxos/test'; | ||
import { type AsyncEvents, TimeoutError } from './errors'; | ||
@@ -11,0 +9,0 @@ import { latch } from './latch'; |
@@ -5,6 +5,4 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, onTestFinished, test } from 'vitest'; | ||
import { afterTest, describe, test } from '@dxos/test'; | ||
import { Event } from './events'; | ||
@@ -27,3 +25,3 @@ import { MulticastObservable, Observable, PushStream } from './observable'; | ||
}); | ||
afterTest(() => subscription.unsubscribe()); | ||
onTestFinished(() => subscription.unsubscribe()); | ||
await trigger.wait(); | ||
@@ -51,4 +49,4 @@ }); | ||
afterTest(() => subscription1.unsubscribe()); | ||
afterTest(() => subscription2.unsubscribe()); | ||
onTestFinished(() => subscription1.unsubscribe()); | ||
onTestFinished(() => subscription2.unsubscribe()); | ||
@@ -106,3 +104,3 @@ const next = { new: 'value' }; | ||
}); | ||
afterTest(() => subscription.unsubscribe()); | ||
onTestFinished(() => subscription.unsubscribe()); | ||
expect(await result.wait()).to.deep.equal(6); | ||
@@ -128,3 +126,3 @@ }); | ||
}); | ||
afterTest(() => subscription.unsubscribe()); | ||
onTestFinished(() => subscription.unsubscribe()); | ||
expect(await result.wait()).to.deep.equal(6); | ||
@@ -131,0 +129,0 @@ }); |
@@ -5,7 +5,5 @@ // | ||
import { expect } from 'chai'; | ||
import waitForExpect from 'wait-for-expect'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { Context } from '@dxos/context'; | ||
import { describe, test } from '@dxos/test'; | ||
@@ -29,5 +27,3 @@ import { DeferredTask, scheduleTask } from './task-scheduling'; | ||
await waitForExpect(() => { | ||
expect(error.message).to.eq('test'); | ||
}); | ||
await expect.poll(() => error.message).toBe('test'); | ||
}); | ||
@@ -34,0 +30,0 @@ |
@@ -64,2 +64,3 @@ // | ||
} | ||
this.schedule(); | ||
@@ -66,0 +67,0 @@ await this._nextTask.wait(); |
@@ -5,3 +5,3 @@ // | ||
import { test } from '@dxos/test'; | ||
import { test } from 'vitest'; | ||
@@ -8,0 +8,0 @@ import { TestStream } from './test-stream'; |
@@ -5,6 +5,5 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { expectToThrow } from '@dxos/debug'; | ||
import { describe, test } from '@dxos/test'; | ||
@@ -11,0 +10,0 @@ import { waitForCondition } from './testing'; |
@@ -5,7 +5,4 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { expectToThrow } from '@dxos/debug'; | ||
import { describe, test } from '@dxos/test'; | ||
import { asyncTimeout, sleep } from './timeout'; | ||
@@ -22,3 +19,3 @@ | ||
const promise = sleep(200).then(() => 'test'); | ||
await expectToThrow(() => asyncTimeout(promise, 100, new Error('timeout'))); | ||
await expect(() => asyncTimeout(promise, 100, new Error('timeout'))).rejects.toThrowError(); | ||
}); | ||
@@ -25,0 +22,0 @@ |
@@ -5,12 +5,7 @@ // | ||
import chai, { expect } from 'chai'; | ||
import chaiAsPromised from 'chai-as-promised'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { describe, test } from '@dxos/test'; | ||
import { sleep } from './timeout'; | ||
import { Trigger, TriggerState, trigger } from './trigger'; | ||
chai.use(chaiAsPromised); | ||
describe('trigger', () => { | ||
@@ -56,3 +51,3 @@ test('trigger', async () => { | ||
trigger.throw(error); | ||
await expect(promise).to.be.rejectedWith(error); | ||
await expect(promise).rejects.toThrowError(error); | ||
expect(trigger.state).to.equal(TriggerState.REJECTED); | ||
@@ -59,0 +54,0 @@ trigger.reset(); |
@@ -5,7 +5,4 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { expectToThrow } from '@dxos/debug'; | ||
import { describe, test } from '@dxos/test'; | ||
import { sleep } from './timeout'; | ||
@@ -26,3 +23,3 @@ import { until } from './until'; | ||
test('error', async () => { | ||
await expectToThrow(async () => { | ||
await expect(async () => { | ||
await until(async (resolve, reject) => { | ||
@@ -32,7 +29,7 @@ await sleep(100); | ||
}); | ||
}); | ||
}).rejects.toThrowError(); | ||
}); | ||
test('catch', async () => { | ||
await expectToThrow(async () => { | ||
await expect(async () => { | ||
await until(async () => { | ||
@@ -42,7 +39,7 @@ await sleep(100); | ||
}); | ||
}); | ||
}).rejects.toThrowError(); | ||
}); | ||
test('timeout', async () => { | ||
await expectToThrow(async () => { | ||
await expect(async () => { | ||
await until(async (resolve) => { | ||
@@ -52,4 +49,4 @@ await sleep(500); | ||
}, 100); // Timeout before complete. | ||
}); | ||
}).rejects.toThrowError(); | ||
}); | ||
}); |
@@ -5,6 +5,5 @@ // | ||
import { expect } from 'chai'; | ||
import { describe, expect, test } from 'vitest'; | ||
import { Context } from '@dxos/context'; | ||
import { describe, test } from '@dxos/test'; | ||
@@ -11,0 +10,0 @@ import { sleep } from './timeout'; |
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
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
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
507560
117
7132
4
+ Added@dxos/context@0.6.14-main.7bd9c89(transitive)
+ Added@dxos/debug@0.6.14-main.7bd9c89(transitive)
+ Added@dxos/invariant@0.6.14-main.7bd9c89(transitive)
+ Added@dxos/keys@0.6.14-main.7bd9c89(transitive)
+ Added@dxos/log@0.6.14-main.7bd9c89(transitive)
+ Added@dxos/node-std@0.6.14-main.7bd9c89(transitive)
+ Added@dxos/util@0.6.14-main.7bd9c89(transitive)
- Removed@dxos/context@0.6.13(transitive)
- Removed@dxos/debug@0.6.13(transitive)
- Removed@dxos/invariant@0.6.13(transitive)
- Removed@dxos/keys@0.6.13(transitive)
- Removed@dxos/log@0.6.13(transitive)
- Removed@dxos/node-std@0.6.13(transitive)
- Removed@dxos/util@0.6.13(transitive)
- Removed@effect/schema@0.67.24(transitive)
- Removedeffect@3.10.15(transitive)
- Removedfast-check@3.23.1(transitive)
- Removedpure-rand@6.1.0(transitive)
- Removedxcase@2.0.1(transitive)