0.10.5 • Published 1 year ago

@plasma-platform/clock-timer v0.10.5

Weekly downloads
42
License
ISC
Repository
gitlab
Last release
1 year ago

version nextVersion downloads license dependency


Full documentation
install:
npm i @plasma-platform/clock-timer -S

Short documentation

Table of Contents

ClockTimer

Creates CNT1A promotion timer

ClockTimer

Creates CNT1C promotion timer

ClockTimer

clock-timer model

init

Initializes the timer

Parameters

  • args Object
    • args.locale string timer locale
    • args.count number? Quantity of ticks for 'counter' timerFace type.
    • args.timerFace string Timer type (daily | hourly | counter). 'daily' by default
    • args.timerName string Unique name for the timer
    • args.startTimeStamp number? Timer start date
    • args.endTimeStamp number Timer end date
    • args.direction string Timer count direction ('decrement' | 'increment') // TODO: implement direction behaviour

updateTimer

updates timer value(s)

Parameters

  • changedTime Object timer changed values
  • timerId number generated id to distinguish which timer to update

Returns boolean

getChangedValues

Compares new and old date and decides which values to change

Parameters

  • newTime Object new time object

Returns Object Values to be changed

init

Initializes the timer

Parameters

  • args Object
    • args.locale string timer locale
    • args.count number? Quantity of ticks for 'counter' timerFace type.
    • args.timerFace string Timer type (daily | hourly | counter). 'daily' by default
    • args.timerName string Unique name for the timer
    • args.startTimeStamp number? Timer start date
    • args.endTimeStamp number Timer end date
    • args.direction string Timer count direction ('decrement' | 'increment') // TODO: implement direction behaviour

updateTimer

updates timer value(s)

Parameters

  • changedTime Object timer changed values
  • timerId number generated id to distinguish which timer to update

Returns boolean

getChangedValues

Compares new and old date and decides which values to change

Parameters

  • newTime Object new time object

Returns Object Values to be changed

start

Start clock-timer

stop

Stops clock-timer

calculateTime

Calculates initial time

Parameters

  • intervalTime number 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

  • intervalTime number clock-timer interval in milliseconds

Returns boolean

mergeDeep

Merges objects

Parameters

Returns object

0.10.3

1 year ago

0.10.4

1 year ago

0.10.5

1 year ago

0.10.2

1 year ago

0.10.1

2 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.9.0

6 years ago

0.8.7

6 years ago

0.8.6

6 years ago

0.8.5

6 years ago

0.8.4

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.6.0-alpha.0

6 years ago

0.5.7-alpha.0

6 years ago

0.5.6

6 years ago

0.5.6-alpha.0

6 years ago

0.5.5-alpha.0

6 years ago

0.5.4

6 years ago

0.5.2

6 years ago

0.5.2-alpha.0

6 years ago

0.5.1-alpha.0

6 years ago

0.4.0-alpha.0

6 years ago