Skip to content

rootsher/use-sheets-queue

Repository files navigation

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

About

use-sheets-queue hook for sheets management.

Resources

Stars

Watchers

Forks

Packages

No packages published