refactor: remove console logs and enhance model userData structure
This commit is contained in:
@@ -343,14 +343,21 @@ export const useSelectedPath = create<any>((set: any) => ({
|
||||
interface SimulationPathsStore {
|
||||
simulationPaths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
|
||||
setSimulationPaths: (
|
||||
paths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
|
||||
paths:
|
||||
| (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
|
||||
| ((prev: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
|
||||
) => (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[])
|
||||
) => void;
|
||||
}
|
||||
|
||||
export const useSimulationPaths = create<SimulationPathsStore>((set) => ({
|
||||
simulationPaths: [],
|
||||
setSimulationPaths: (paths) => set({ simulationPaths: paths }),
|
||||
}));
|
||||
setSimulationPaths: (paths) =>
|
||||
set((state) => ({
|
||||
simulationPaths:
|
||||
typeof paths === "function" ? paths(state.simulationPaths) : paths,
|
||||
})),
|
||||
}))
|
||||
|
||||
export const useIsConnecting = create<any>((set: any) => ({
|
||||
isConnecting: false,
|
||||
|
||||
Reference in New Issue
Block a user