more refactoring

This commit is contained in:
2024-07-02 09:08:49 +02:00
parent de148eaf19
commit 1971966099
27 changed files with 400 additions and 324 deletions
+2
View File
@@ -0,0 +1,2 @@
export * from './statetypes';
export * from './stateutils';
+1 -9
View File
@@ -1,12 +1,4 @@
import { Dispatch, SetStateAction } from "react";
export type StateHook<T> = {
state: T;
setState: Dispatch<SetStateAction<T>>;
};
export type StateHookArray<T> = [
T,Dispatch<SetStateAction<T>>
]
import { StateHookArray, StateHook } from "./statetypes";
export function parseStateHook<T>(hook:StateHookArray<T>):StateHook<T>{
const stateHook:Partial<StateHook<T>> = {};
+9
View File
@@ -0,0 +1,9 @@
import { Dispatch, SetStateAction } from "react";
export type StateHook<T> = {
state: T;
setState: Dispatch<SetStateAction<T>>;
};
export type StateHookArray<T> = [
T,Dispatch<SetStateAction<T>>
]