wip: overview (#688)

* wip: overview
This commit is contained in:
Carlos Valente
2024-01-01 22:06:23 +01:00
committed by GitHub
parent 9a4d659b04
commit 3d9a9a2226
8 changed files with 143 additions and 38 deletions
@@ -16,5 +16,5 @@ export default function useProjectData() {
networkMode: 'always',
});
return { data, status, isFetching, isError, refetch };
return { data: data ?? projectDataPlaceholder, status, isFetching, isError, refetch };
}
+11
View File
@@ -120,3 +120,14 @@ export const useTimer = () => {
};
export const setClientName = (newName: string) => socketSendJson('set-client-name', newName);
export const useRuntimeOverview = () => {
const featureSelector = (state: RuntimeStore) => ({
playback: state.playback,
clock: state.timer.clock,
numEvents: state.loaded.numEvents,
selectedEventIndex: state.loaded.selectedEventIndex,
});
return useRuntimeStore(featureSelector, deepCompare);
};