Comparing version 3.0.0-canary-20240430083410.102beb4dd53f46d77a77cc9009c7998bfd46a084 to 3.0.0-canary-20240430091548.cf33af4d41a6665a4bca713d5229a0e1fadc7903
{ | ||
"name": "gqty", | ||
"version": "3.0.0-canary-20240430083410.102beb4dd53f46d77a77cc9009c7998bfd46a084", | ||
"version": "3.0.0-canary-20240430091548.cf33af4d41a6665a4bca713d5229a0e1fadc7903", | ||
"description": "gqty client without queries", | ||
@@ -32,4 +32,3 @@ "sideEffects": false, | ||
"object-hash": "^3.0.0", | ||
"p-defer": "^3.0.0", | ||
"p-lazy": "^3.1.0" | ||
"p-defer": "^3.0.0" | ||
}, | ||
@@ -36,0 +35,0 @@ "repository": { |
@@ -1,9 +0,1 @@ | ||
export type DeferredState = 'pending' | 'resolved' | 'rejected'; | ||
export type Deferred<T> = { | ||
promise: Promise<T>; | ||
resolve: (value: T) => void; | ||
reject: (error: unknown) => void; | ||
state: DeferredState; | ||
}; | ||
export declare const createDeferred: <T>() => Deferred<T>; | ||
export type DeferredIterator<T> = AsyncGenerator<T, void, unknown> & { | ||
@@ -10,0 +2,0 @@ send: (value: T) => void; |
@@ -5,26 +5,11 @@ 'use strict'; | ||
const createDeferred = () => { | ||
let resolve; | ||
let reject; | ||
let state = "pending"; | ||
const promise = new Promise((res, rej) => { | ||
resolve = (value) => { | ||
state = "resolved"; | ||
res(value); | ||
}; | ||
reject = (error) => { | ||
state = "rejected"; | ||
rej(error); | ||
}; | ||
}); | ||
return { | ||
promise, | ||
resolve, | ||
reject, | ||
state | ||
}; | ||
}; | ||
const createDeferred = require('p-defer'); | ||
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } | ||
const createDeferred__default = /*#__PURE__*/_interopDefault(createDeferred); | ||
const asyncItDoneMessage = { done: true }; | ||
const createDeferredIterator = () => { | ||
let deferred = createDeferred(); | ||
let deferred = createDeferred__default["default"](); | ||
const events = []; | ||
@@ -46,3 +31,3 @@ const next = async () => { | ||
deferred == null ? void 0 : deferred.resolve(); | ||
deferred = createDeferred(); | ||
deferred = createDeferred__default["default"](); | ||
}, | ||
@@ -72,3 +57,2 @@ complete: () => { | ||
exports.createDeferred = createDeferred; | ||
exports.createDeferredIterator = createDeferredIterator; |
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
13
278371
7963
- Removedp-lazy@^3.1.0
- Removedp-lazy@3.1.0(transitive)