feat: request builder option fillStore
This commit is contained in:
parent
f20cd8a119
commit
3ff651ec37
@ -393,7 +393,11 @@ export class Query extends EventEmitter<QueryEvents> {
|
||||
responseTime: qt.responseTime,
|
||||
} as TraceReport),
|
||||
);
|
||||
const handler = (sub: string, ev: TaggedNostrEvent) => this.handleEvent(sub, ev);
|
||||
const handler = (sub: string, ev: TaggedNostrEvent) => {
|
||||
if (this.request.options?.fillStore ?? true) {
|
||||
this.handleEvent(sub, ev);
|
||||
}
|
||||
};
|
||||
c.on("event", handler);
|
||||
this.on("end", () => c.off("event", handler));
|
||||
this.#tracing.push(qt);
|
||||
|
@ -58,6 +58,12 @@ export interface RequestBuilderOptions {
|
||||
* How many milli-seconds to wait to allow grouping
|
||||
*/
|
||||
groupingDelay?: number;
|
||||
|
||||
/**
|
||||
* If events should be added automatically to the internal NoteCollection
|
||||
* default=true
|
||||
*/
|
||||
fillStore?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user