Socket
Socket
Sign inDemoInstall

@dxos/async

Package Overview
Dependencies
Maintainers
24
Versions
2980
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/async - npm Package Compare versions

Comparing version 2.18.1 to 2.18.2

4

dist/src/event.d.ts

@@ -97,2 +97,6 @@ export declare type Effect = () => (() => void) | undefined;

/**
* Similar to waitFor, but the promise resolves immediatelly if the condition is already true.
*/
waitForCondition(predicate: () => boolean): Promise<void>;
/**
* Returns the number of persistent listeners.

@@ -99,0 +103,0 @@ */

@@ -163,2 +163,10 @@ "use strict";

/**
* Similar to waitFor, but the promise resolves immediatelly if the condition is already true.
*/
async waitForCondition(predicate) {
if (!predicate()) {
await this.waitFor(predicate);
}
}
/**
* Returns the number of persistent listeners.

@@ -228,4 +236,9 @@ */

async _trigger(listener, data) {
await waitImmediate(); // Acts like setImmediate but preserves the stack-trace.
listener(data);
try {
await waitImmediate(); // Acts like setImmediate but preserves the stack-trace.
listener(data);
}
catch (err) {
console.error(err);
}
}

@@ -232,0 +245,0 @@ _runEffects() {

6

package.json
{
"name": "@dxos/async",
"version": "2.18.1",
"version": "2.18.2",
"description": "Async utils.",

@@ -27,6 +27,6 @@ "bugs": {

"dependencies": {
"@dxos/debug": "2.18.1"
"@dxos/debug": "2.18.2"
},
"devDependencies": {
"@dxos/toolchain-node-library": "2.18.1",
"@dxos/toolchain-node-library": "2.18.2",
"@types/jest": "^26.0.7",

@@ -33,0 +33,0 @@ "@types/node": "^14.0.9"

@@ -194,2 +194,11 @@ //

/**
* Similar to waitFor, but the promise resolves immediatelly if the condition is already true.
*/
async waitForCondition (predicate: () => boolean): Promise<void> {
if (!predicate()) {
await this.waitFor(predicate);
}
}
/**
* Returns the number of persistent listeners.

@@ -268,4 +277,8 @@ */

private async _trigger (listener: (data: T) => void, data: T) {
await waitImmediate(); // Acts like setImmediate but preserves the stack-trace.
listener(data);
try {
await waitImmediate(); // Acts like setImmediate but preserves the stack-trace.
listener(data);
} catch (err) {
console.error(err);
}
}

@@ -272,0 +285,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc