use-step-machine
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta.2 • Public • Published

useStepMachine

npm bundle size

State machine hook for all things that can make steps.

Project Overview

  • Hook based - feel at home, fellow React developer!
  • Familiar API to regular state machines with an addition of steps.
  • Small - ~500B minified.

Usage

import { useStepMachine } from 'use-step-machine';

const UrBeautififulPagination = () => {
  const { first, last, next, prev, state, step } = useStepMachine({ total: 100 });


  return <div>
    <First onClick={first} />
    <Prev onClick={prev} />
    <Current>{step}</Current>
    <Next onClick={next} />
    <Last onClick={last} />
  </div>
}

Contributors

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i use-step-machine

Weekly Downloads

1

Version

0.1.0-beta.2

License

MIT

Unpacked Size

4.04 kB

Total Files

4

Last publish

Collaborators

  • bring-shrubbery