UNPKG

@byndyusoft-ui/use-toggle

Version:
10 lines (9 loc) 342 B
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 {};