refactor: prevent race conditions on init

This commit is contained in:
Carlos Valente
2024-12-29 20:30:10 +01:00
committed by Carlos Valente
parent f65ec0da3c
commit 0dfef732bf
4 changed files with 29 additions and 15 deletions
+1
View File
@@ -3,6 +3,7 @@ import { RuntimeStore } from 'ontime-types';
import { socket } from '../adapters/WebsocketAdapter.js';
export type PublishFn = <T extends keyof RuntimeStore>(key: T, value: RuntimeStore[T]) => void;
export type StoreGetter = <T extends keyof RuntimeStore>(key: T) => Partial<RuntimeStore>[T];
let store: Partial<RuntimeStore> = {};