From 11a6991b5c02407ce5bac721922b549bda06ed01 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Tue, 8 Nov 2022 21:22:51 +0100 Subject: [PATCH] jsonrpc: ts-client use object instead of array for `contextEmitters` (#3740) reason: the array solution has many empty elements in between accounts in practice, which is annoying when debugging desktop --- deltachat-jsonrpc/typescript/src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deltachat-jsonrpc/typescript/src/client.ts b/deltachat-jsonrpc/typescript/src/client.ts index bc3e280d8..e9f271f5e 100644 --- a/deltachat-jsonrpc/typescript/src/client.ts +++ b/deltachat-jsonrpc/typescript/src/client.ts @@ -28,14 +28,14 @@ type ContextEvents = { ALL: (event: Event) => void } & { }; export type DcEvent = Event; -export type DcEventType = Extract +export type DcEventType = Extract; export class BaseDeltaChat< Transport extends BaseTransport > extends TinyEmitter { rpc: RawClient; account?: T.Account; - private contextEmitters: TinyEmitter[] = []; + private contextEmitters: { [key: number]: TinyEmitter } = {}; constructor(public transport: Transport) { super(); this.rpc = new RawClient(this.transport);