Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 1.59 KB

README.md

File metadata and controls

61 lines (44 loc) · 1.59 KB

npm version npm downloads GitHub issues GitHub PRs ISC license

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();