@most/scheduler
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -149,2 +149,3 @@ import { curry2, curry3, findIndex, removeAll } from '@most/prelude'; | ||
ScheduledTask.prototype.dispose = function dispose() { | ||
this.active = false; | ||
this.scheduler.cancel(this); | ||
@@ -322,5 +323,9 @@ return this.task.dispose(); | ||
if (i >= 0 && i < this.tasks.length) { | ||
var at = findIndex(st, this.tasks[i].events); | ||
var events = this.tasks[i].events; | ||
var at = findIndex(st, events); | ||
if (at >= 0) { | ||
this.tasks[i].events.splice(at, 1); | ||
events.splice(at, 1); | ||
if (events.length === 0) { | ||
this.tasks.splice(i, 1); | ||
} | ||
return true; | ||
@@ -559,2 +564,5 @@ } | ||
// @deprecated will be removed in 2.0.0 | ||
// Date.now is not monotonic, and performance.now is ubiquitous: | ||
// See https://caniuse.com/#search=performance.now | ||
var newDateClock = function newDateClock() { | ||
@@ -561,0 +569,0 @@ return clockRelativeTo(Date); |
@@ -153,2 +153,3 @@ (function (global, factory) { | ||
ScheduledTask.prototype.dispose = function dispose() { | ||
this.active = false; | ||
this.scheduler.cancel(this); | ||
@@ -326,5 +327,9 @@ return this.task.dispose(); | ||
if (i >= 0 && i < this.tasks.length) { | ||
var at = prelude.findIndex(st, this.tasks[i].events); | ||
var events = this.tasks[i].events; | ||
var at = prelude.findIndex(st, events); | ||
if (at >= 0) { | ||
this.tasks[i].events.splice(at, 1); | ||
events.splice(at, 1); | ||
if (events.length === 0) { | ||
this.tasks.splice(i, 1); | ||
} | ||
return true; | ||
@@ -563,2 +568,5 @@ } | ||
// @deprecated will be removed in 2.0.0 | ||
// Date.now is not monotonic, and performance.now is ubiquitous: | ||
// See https://caniuse.com/#search=performance.now | ||
var newDateClock = function newDateClock() { | ||
@@ -565,0 +573,0 @@ return clockRelativeTo(Date); |
{ | ||
"name": "@most/scheduler", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Reactive programming with lean, functions-only, curried, tree-shakeable API", | ||
@@ -5,0 +5,0 @@ "typings": "type-definitions/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
81996
1058