Socket
Book a DemoInstallSign in
Socket

cordova-plugin-timer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-timer - npm Package Compare versions

Comparing version

to
1.0.1

2

package.json
{
"name": "cordova-plugin-timer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Cordova Native Timer Plugin",

@@ -5,0 +5,0 @@ "types": "./types/index.d.ts",

@@ -60,2 +60,5 @@ cordova-plugin-timer

#### `on: (eventName: string, callback: function) => void`
Syntax sugar for the event handlers (onTick, onStop, onError)
eventName: `error`, `tick`, `stop`

@@ -85,2 +88,3 @@ ### Methods

## What's new
- 1.0.0 - initial code
- 1.0.0 - initial code
- 1.0.1 - added common event handler

@@ -33,2 +33,3 @@ /**

this._state = NativeTimer.State.STOPPED;
this.timerKey = guid();
this.onTick = function () {

@@ -44,3 +45,24 @@ console.log('On timer tick');

};
this.timerKey = guid();
this.on = function (eventName, callback) {
if ((typeof eventName === 'string') && (typeof callback === 'function')) {
switch (eventName) {
case 'tick':
this.onTick = function (e) {
callback(e);
};
break;
case 'stop':
this.onStop = function (e) {
callback(e);
};
break;
case 'error':
this.onError = function (e) {
callback(e);
};
break;
}
}
};
}

@@ -47,0 +69,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.