2.0 Overhaul start

This commit is contained in:
Sacha Weatherstone
2022-09-22 16:35:40 +10:00
parent 4e45990ef5
commit a73eab1ea6
87 changed files with 2880 additions and 3573 deletions
+3 -3
View File
@@ -1,13 +1,13 @@
import { createContext, useContext } from "react";
import { createContext, useContext } from 'react';
import type { Device } from "@core/stores/deviceStore.js";
import type { Device } from '@core/stores/deviceStore.js';
export const DeviceContext = createContext<Device | undefined>(undefined);
export const useDevice = (): Device => {
const context = useContext(DeviceContext);
if (context === undefined) {
throw new Error("useDevice must be used within a ConnectionProvider");
throw new Error("useDevice must be used within a DeviceProvider");
}
return context;
};