@plasma-platform/clock-timer

    0.10.0 • Public • Published

    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

    • objects Array<object> one or more objects to be merged

    Returns object

    Install

    npm i @plasma-platform/clock-timer

    DownloadsWeekly Downloads

    17

    Version

    0.10.0

    License

    ISC

    Unpacked Size

    106 kB

    Total Files

    11

    Last publish

    Collaborators

    • soulwish
    • tmrdowner
    • ch-tm
    • viram
    • kyrylovoronoi