@rootsher/use-sheets-queue
v0.1.7
Published
use-sheets-queue hook for sheets management
Downloads
6
Readme
@rootsher/use-sheets-queue
installation
$ npm install --save @rootsher/use-sheets-queue
demo
usage
- sheets provider:
import { SheetsProvider } from '@rootsher/use-sheets-queue';
function Main() {
return (
<SheetsProvider>
{/* App */}
</SheetsProvider>
);
}
- sheets management (LIFO - push, pop):
import { useSheetsQueue } from '@rootsher/use-sheets-queue';
import { A } from './sheets';
function App() {
const [ push ] = useSheetsQueue();
return (
<Button onClick={() => push(A)}>push</Button>
);
}
API
type Options = {
side?: 'left' | 'right' | 'bottom' | 'top';
size?: number;
};
function push(Element, options?: Options, previousOptions?: Options);
function pop();