solid-awesome-hooks
Version:
A collection of awesome hooks for solid-js
11 lines (10 loc) • 463 B
TypeScript
type Action = "hide" | "reveal";
export declare const useVisibleState: (initialState?: boolean) => {
isOpen: import("solid-js").Accessor<boolean>;
setOpen: import("solid-js").Setter<boolean>;
hide: () => false;
reveal: () => true;
/** A useful wrapper which adds `reveal` or `hide` action for wrapping function */
withAction: <T extends any[], U>(action: Action, callback?: (...args: T) => U) => (...args: T) => U;
};
export {};