Creates a Counter object with an optional initialValue, defaults to 0.
initialValue
0
Create a countdown
const clickCountdown = counter(10);const handleClickEvent = () => { clickCountdown.dec(); if(isZero(clickCountdown.get())) { console.log("0"); clickCountdown.set(5); }};
the Counter object
the initial value
Generated using TypeDoc
Creates a Counter object with an optional
initialValue, defaults to0.Example
Create a countdown
Returns
the Counter object