Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

State machine hook for all things that can make steps.

License

Notifications You must be signed in to change notification settings

bring-shrubbery/use-step-machine

Repository files navigation

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

About

State machine hook for all things that can make steps.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published