diff --git a/src/main/services/patcher/patcher.ts b/src/main/services/patcher/patcher.ts index 2b554e59..8ab8186e 100644 --- a/src/main/services/patcher/patcher.ts +++ b/src/main/services/patcher/patcher.ts @@ -145,7 +145,7 @@ export class Patcher { * @param listener A function that will be called when the object changes. * @returns A subscription ID that can be used to unsubscribe. */ - subscribe(listener: PatchListener): number { + subscribe(listener?: PatchListener): number { const key = this.nextKey(); this.subscribers[key] = this.observable.subscribe(listener); diff --git a/src/tests/unit/services/patcher/patcher-test.ts b/src/tests/unit/services/patcher/patcher-test.ts index 3151e808..a0fec1d9 100644 --- a/src/tests/unit/services/patcher/patcher-test.ts +++ b/src/tests/unit/services/patcher/patcher-test.ts @@ -154,7 +154,7 @@ describe('patcher class.', () => { test('suppresses patches on a changed address for a limited time.', async () => { const patcher = new Patcher(); patcher.initialize({ x: 42 }); - patcher.subscribe(() => {}); + patcher.subscribe(); patcher.check({ x: 43 }); await sleep(1);