pw-basic-counters
v1.1.2
Published
Package with __`Counter`__ and __`DecreasingCounter`__ constructors - two counters.
Downloads
7
Readme
pw-basic-counters
Package with Counter
and DecreasingCounter
constructors - two counters.
Getting started:
Installation:
In order to install, you need to run this command:
npm install pw-basic-counters
Usage:
To run the demo app, clone this repo and simply run:
npm install
npm start
API:
Every counter gets two arguments:
- A selector of the element to be rendered. - required
- A number from which the counter starts to count. By default, it starts to count from 0. - optional
The counter should be initialized after creation by calling an .init()
method.
Example:
A simple example of generating two counters and initializing them:
import { Counter, DecreasingCounter } from 'pw-basic-counters'
const counter1 = new Counter('.counter-1')
counter1.init()
const counter2 = new DecreasingCounter('.counter-2', 5)
counter2.init()
Troubleshooting:
If you find any problems with this package implementation, please report them by sending an email to: [email protected]