@jayarjo/scheduler
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -30,3 +30,3 @@ import { guid, isPromise } from './Utils'; | ||
onSuccess: () => { }, | ||
onFailure: () => { } | ||
onFailure: () => { }, | ||
}; | ||
@@ -70,8 +70,8 @@ this.schema = Object.assign({}, defaults, typeof arg === 'function' ? { fn: arg } : arg); | ||
run() { | ||
const { fn, args = [], onSuccess, onFailure, repeatTimesBeforeFail } = this.schema; | ||
const { fn, args = [], onSuccess, onFailure, repeatTimesBeforeFail, } = this.schema; | ||
if (this._state !== TaskState.IDLE) { | ||
return Promise.reject(new Error(`task ${this.uid} is either already ${this.state}!`)); | ||
} | ||
const handleCompletion = isOk => { | ||
return result => { | ||
const handleCompletion = (isOk) => { | ||
return (result) => { | ||
if (isOk) { | ||
@@ -78,0 +78,0 @@ if (this.isOneTime) { |
@@ -13,7 +13,2 @@ export const isIterable = obj => obj && typeof obj[Symbol.iterator] === 'function'; | ||
})(); | ||
export const invariant = (expr, errMsg) => { | ||
if (expr) { | ||
throw new Error(errMsg); | ||
} | ||
}; | ||
export const isPromise = obj => obj && typeof obj.then === 'function'; | ||
@@ -20,0 +15,0 @@ export const random = (min, max) => { |
{ | ||
"name": "@jayarjo/scheduler", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Schedule a task to execute after some period, regularly with a given interval, just given amount of times, or simply until it succeeds.", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
@@ -7,0 +8,0 @@ "lib/" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19165
14
536