(value: T)
| 5 | #queue = new SinglyLinkedList<(item: T) => unknown>(); |
| 6 | |
| 7 | push(value: T) { |
| 8 | const resolve = this.#queue.shift(); |
| 9 | if (resolve !== undefined) { |
| 10 | resolve(value); |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | this.#list.push(value); |
| 15 | } |
| 16 | |
| 17 | shift() { |
| 18 | return this.#list.shift(); |