use-step-machine
v0.1.0-beta.2
Published
State machine hook for all things that can make steps.
Downloads
3
Readme
useStepMachine
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>
}