counter
which the user can toggle between incrementing
, decrementing
, and paused
states. The parent component has a simple state: { counter: 0, direction: 'NONE' }
. The buttons in the UI alter the direction
state.setDirection
callback function.setDirection
is called, the value it was called with is dispatched.type
.increase
, infinitely counts downwards after the user clicks decrease
, or stays static after the user clicks pause
.