Added nono profiles & orca integration - Added some extensions to start working on
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export function createDeferredResultDelivery<T extends { id: string }>() {
|
||||
const pending = new Map<string, T>();
|
||||
|
||||
return {
|
||||
defer(result: T) {
|
||||
pending.set(result.id, result);
|
||||
},
|
||||
consume(ids: Iterable<string>) {
|
||||
for (const id of ids) pending.delete(id);
|
||||
},
|
||||
drain() {
|
||||
const results = [...pending.values()];
|
||||
pending.clear();
|
||||
return results;
|
||||
},
|
||||
clear() {
|
||||
pending.clear();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user