import { StateHookArray, StateHook } from "./statetypes";

export function parseStateHook<T>(hook:StateHookArray<T>):StateHook<T>{
    const stateHook:Partial<StateHook<T>> = {};
    [stateHook.state, stateHook.setState] = hook;
    return stateHook as StateHook<T>
}