Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
timermodule
Advanced tools
Readme
Import it as
import Timer from "timermodule";
Create an instance for it and initialize it (using init method) before using the methods of the instance.
let timerObj = new Timer();
timerObj.init(initializationData);
The above initialization data object is of the pattern:
"data" : {
"mytimer(yourtimername)" : {
time : {
hh : "00",
mm : "00",
ss : "00
},
status : "INIT"
}
},
"notifier" : "notifierFunction"
If many timers are required, give each timer a unique key and add the data in the above format.
The notifier function will be called each time for a change in timer object. The notifier function will get an arguement in the format : (key, value). The value will be in the format as below :
"time"(keyword) : {
hh(keyword) : "<values>",
mm(keyword) : "<values>",
ss(keyword) : "<values>"
},
"status"(keyword) : "INIT (OR) RUNNING (OR) PAUSED"
**Once you are done with creating an instance and initializing it, you can proceed calling the methods available on the timer instance **
The main action methods available in timer object instance are as follows :
start, pause, resume, reset.
You have call the above functions with the name of your timer as arguement. Eg : start("mytimer")
.
To update the timer abruptly, you can use updateTimerState
method.
Eg : updateTimerState(<nameoftimer>, <actionname>, <durationinhh,mm,ssobformat))
;
i.e nameoftimer - In the above example - "mytimer". actionname - supported values are : START, RESUME, PAUSE, RESET durationinhh,mm,ssobformat - time object in the format { hh , mm, ss}
Examples available in : CodeSandbox example link
FAQs
Import it as
The npm package timermodule receives a total of 5 weekly downloads. As such, timermodule popularity was classified as not popular.
We found that timermodule demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.