Revision 44fb2f32a75d3c7333c893fcfee6822cf25c0450 authored by Viraj-10 on 11 October 2022, 11:32:35 UTC, committed by Viraj-10 on 11 October 2022, 11:32:35 UTC
1 parent e2a05f1
useDisclose.ts
import React from 'react';
export function useDisclose(initState?: boolean) {
const [isOpen, setIsOpen] = React.useState(initState || false);
const onOpen = () => {
setIsOpen(true);
};
const onClose = () => {
setIsOpen(false);
};
const onToggle = () => {
setIsOpen(!isOpen);
};
return {
isOpen,
onOpen,
onClose,
onToggle,
};
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...