A local-first personal finance app
[TypeScript] Add types to loot-core app (#4155)
Joel Jeremy Marquezf07ad1f8c6dc
diff --git a/packages/loot-core/src/server/app.ts b/packages/loot-core/src/server/app.tsindex a8005a25fb..38a9e01fe1 100644--- a/packages/loot-core/src/server/app.ts+++ b/packages/loot-core/src/server/app.ts@@ -14,16 +14,19 @@ type Events = {'load-budget': { id: string };};+type UnlistenService = () => void;+type Service = () => UnlistenService;+class App<Handlers> {events: Emitter<Events>;handlers: Handlers;- services;- unlistenServices;+ services: Service[];+ unlistenServices: UnlistenService[];constructor() {this.handlers = {} as Handlers;this.services = [];- this.events = mitt();+ this.events = mitt<Events>();this.unlistenServices = [];}@@ -39,7 +42,7 @@ class App<Handlers> {this.handlers[name] = func;}- service(func) {+ service(func: Service) {this.services.push(func);}diff --git a/upcoming-release-notes/4155.md b/upcoming-release-notes/4155.mdnew file mode 100644index 0000000000..1b50cad187--- /dev/null+++ b/upcoming-release-notes/4155.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [joel-jeremy]+---++Add types to loot-core app