@byndyusoft-ui/use-toggle
Version:
Byndyusoft UI React Hook
10 lines (9 loc) • 342 B
TypeScript
type TInitialValue<V> = V | (() => V);
interface IUseToggleMethods {
toLeftValue: () => void;
toRightValue: () => void;
toggle: () => void;
}
export type TUseToggle<V> = [V, IUseToggleMethods];
export default function useToggle<L, R>(leftValue: L, rightValue: R, initialValue: TInitialValue<L | R>): TUseToggle<L | R>;
export {};