feat: request builder option fillStore

This commit is contained in:
2024-01-18 13:06:52 +00:00
parent f20cd8a119
commit 3ff651ec37
2 changed files with 11 additions and 1 deletions

View File

@ -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);