more refactoring
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
export * from './statetypes';
|
||||
export * from './stateutils';
|
||||
@@ -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>> = {};
|
||||
|
||||
@@ -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>>
|
||||
]
|
||||
Reference in New Issue
Block a user