Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@plasma-platform/clock-timer

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plasma-platform/clock-timer

Counter for promotions

  • 0.10.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

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

Keywords

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc