0.1.0-beta.2 • Published 2 years ago

use-step-machine v0.1.0-beta.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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