Skip to content

Commit e126b58

Browse files
committed
ref(utils): remove length and isReady from public api
1 parent 29b6914 commit e126b58

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

packages/utils/src/promisebuffer.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ function allPromises<U = unknown>(collection: Array<U | PromiseLike<U>>): Promis
2424

2525
export interface PromiseBuffer<T> {
2626
_buffer: Array<PromiseLike<T>>;
27-
isReady(): boolean;
2827
add(taskProducer: () => PromiseLike<T>): PromiseLike<T>;
2928
remove(task: PromiseLike<T>): PromiseLike<T>;
30-
length(): number;
3129
drain(timeout?: number): PromiseLike<boolean>;
3230
}
3331

@@ -38,15 +36,8 @@ export interface PromiseBuffer<T> {
3836
export function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {
3937
const buffer: Array<PromiseLike<T>> = [];
4038

41-
/**
42-
* This function returns the number of unresolved promises in the queue.
43-
*/
44-
function length(): number {
45-
return buffer.length;
46-
}
47-
4839
function isReady(): boolean {
49-
return limit === undefined || length() < limit;
40+
return limit === undefined || buffer.length < limit;
5041
}
5142

5243
/**
@@ -120,8 +111,6 @@ export function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {
120111

121112
const promiseBuffer: PromiseBuffer<T> = {
122113
_buffer: buffer,
123-
length,
124-
isReady,
125114
add,
126115
remove,
127116
drain,

0 commit comments

Comments
 (0)