@plasma-platform/clock-timer v0.10.5
Full documentation
install:npm i @plasma-platform/clock-timer -S
Short documentation
Table of Contents
- ClockTimer
- ClockTimer
- ClockTimer
- init
- updateTimer
- getChangedValues
- init
- updateTimer
- getChangedValues
- start
- stop
- calculateTime
- tick
- mergeDeep
ClockTimer
Creates CNT1A promotion timer
ClockTimer
Creates CNT1C promotion timer
ClockTimer
clock-timer model
init
Initializes the timer
Parameters
argsObjectargs.localestring timer localeargs.countnumber? Quantity of ticks for 'counter' timerFace type.args.timerFacestring Timer type (daily | hourly | counter). 'daily' by defaultargs.timerNamestring Unique name for the timerargs.startTimeStampnumber? Timer start dateargs.endTimeStampnumber Timer end dateargs.directionstring Timer count direction ('decrement' | 'increment') // TODO: implement direction behaviour
updateTimer
updates timer value(s)
Parameters
changedTimeObject timer changed valuestimerIdnumber generated id to distinguish which timer to update
Returns boolean
getChangedValues
Compares new and old date and decides which values to change
Parameters
newTimeObject new time object
Returns Object Values to be changed
init
Initializes the timer
Parameters
argsObjectargs.localestring timer localeargs.countnumber? Quantity of ticks for 'counter' timerFace type.args.timerFacestring Timer type (daily | hourly | counter). 'daily' by defaultargs.timerNamestring Unique name for the timerargs.startTimeStampnumber? Timer start dateargs.endTimeStampnumber Timer end dateargs.directionstring Timer count direction ('decrement' | 'increment') // TODO: implement direction behaviour
updateTimer
updates timer value(s)
Parameters
changedTimeObject timer changed valuestimerIdnumber generated id to distinguish which timer to update
Returns boolean
getChangedValues
Compares new and old date and decides which values to change
Parameters
newTimeObject new time object
Returns Object Values to be changed
start
Start clock-timer
stop
Stops clock-timer
calculateTime
Calculates initial time
Parameters
intervalTimenumber Interval time (for setInterval function)
Returns (Object | number) 'time' object or 'count' (depends on 'timerFace' property)
tick
Function to be executed every timer tick. Calculates new time or count
Parameters
intervalTimenumber clock-timer interval in milliseconds
Returns boolean
mergeDeep
Merges objects
Parameters
Returns object
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago