@reactive-js/scheduler
Advanced tools
Comparing version 0.0.33 to 0.0.34
@@ -1,2 +0,2 @@ | ||
export { SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, PrioritySchedulerLike, HostSchedulerLike, } from "./internal/interfaces"; | ||
export { SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, PrioritySchedulerLike, CallbackSchedulerLike, } from "./internal/interfaces"; | ||
export { AbstractSchedulerContinuation } from "./internal/abstractSchedulerContinuation"; | ||
@@ -3,0 +3,0 @@ export { createPriorityScheduler } from "./internal/priorityScheduler"; |
@@ -1,14 +0,11 @@ | ||
import { add, dispose } from "@reactive-js/disposable"; | ||
import { AbstractDisposable } from "@reactive-js/disposable"; | ||
import { SchedulerContinuationLike, SchedulerContinuationRunStatusChangedListenerLike } from "./interfaces"; | ||
export declare abstract class AbstractSchedulerContinuation implements SchedulerContinuationLike { | ||
readonly add: typeof add; | ||
export declare abstract class AbstractSchedulerContinuation extends AbstractDisposable implements SchedulerContinuationLike { | ||
private isActive; | ||
readonly disposable: import("@reactive-js/disposable").DisposableLike; | ||
readonly dispose: typeof dispose; | ||
private readonly listeners; | ||
constructor(); | ||
addListener(_ev: "onRunStatusChanged", listener: SchedulerContinuationRunStatusChangedListenerLike): void; | ||
removeListener(_ev: "onRunStatusChanged", listener: SchedulerContinuationRunStatusChangedListenerLike): void; | ||
get isDisposed(): boolean; | ||
abstract produce(shouldYield?: () => boolean): number; | ||
run(shouldYield?: () => boolean): number; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const disposable_1 = require("@reactive-js/disposable"); | ||
const option_1 = require("@reactive-js/option"); | ||
const notifyListeners = (listeners, state) => { | ||
@@ -9,7 +10,8 @@ for (const listener of listeners) { | ||
}; | ||
class AbstractSchedulerContinuation { | ||
class AbstractSchedulerContinuation extends disposable_1.AbstractDisposable { | ||
constructor() { | ||
this.add = disposable_1.add; | ||
super(); | ||
this.isActive = false; | ||
this.disposable = disposable_1.createDisposable(() => { | ||
this.listeners = new Set(); | ||
this.add(() => { | ||
if (!this.isActive) { | ||
@@ -19,4 +21,2 @@ this.listeners.clear(); | ||
}); | ||
this.dispose = disposable_1.dispose; | ||
this.listeners = new Set(); | ||
} | ||
@@ -31,9 +31,6 @@ addListener(_ev, listener) { | ||
} | ||
get isDisposed() { | ||
return this.disposable.isDisposed; | ||
} | ||
run(shouldYield) { | ||
const listeners = this.listeners; | ||
let result = -1; | ||
let error = undefined; | ||
let error = option_1.none; | ||
if (!this.isDisposed) { | ||
@@ -52,3 +49,3 @@ this.isActive = true; | ||
const isDisposed = this.isDisposed; | ||
if (!isDisposed && error !== undefined) { | ||
if (!isDisposed && option_1.isSome(error)) { | ||
this.dispose(error); | ||
@@ -55,0 +52,0 @@ } |
import { DisposableLike } from "@reactive-js/disposable"; | ||
import { Option } from "@reactive-js/option"; | ||
export interface SchedulerContinuationRunStatusChangedListenerLike { | ||
@@ -22,6 +23,6 @@ onRunStatusChanged(state: boolean): void; | ||
} | ||
export interface HostSchedulerLike extends SchedulerLike { | ||
export interface CallbackSchedulerLike extends SchedulerLike { | ||
inContinuation: boolean; | ||
readonly shouldYield: (() => boolean) | undefined; | ||
readonly shouldYield: Option<() => boolean>; | ||
scheduleCallback(callback: () => void, delay: number): DisposableLike; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const collections_1 = require("@reactive-js/collections"); | ||
const disposable_1 = require("@reactive-js/disposable"); | ||
const priorityQueue_1 = require("./priorityQueue"); | ||
const option_1 = require("@reactive-js/option"); | ||
const abstractSchedulerContinuation_1 = require("./abstractSchedulerContinuation"); | ||
@@ -16,4 +17,4 @@ const alwaysFalse = () => false; | ||
const next = peek(scheduler); | ||
const nextTaskIsHigherPriority = current !== undefined && | ||
next !== undefined && | ||
const nextTaskIsHigherPriority = option_1.isSome(current) && | ||
option_1.isSome(next) && | ||
current !== next && | ||
@@ -26,6 +27,6 @@ next.dueTime <= scheduler.now && | ||
produce(hostShouldYield) { | ||
this.hostShouldYield = hostShouldYield || alwaysFalse; | ||
this.hostShouldYield = hostShouldYield !== null && hostShouldYield !== void 0 ? hostShouldYield : alwaysFalse; | ||
const { scheduler } = this; | ||
const { delayed, queue } = scheduler; | ||
for (let task = peek(scheduler), isDisposed = this.isDisposed; task !== undefined && !isDisposed; task = peek(scheduler)) { | ||
for (let task = peek(scheduler), isDisposed = this.isDisposed; option_1.isSome(task) && !isDisposed; task = peek(scheduler)) { | ||
const { continuation, dueTime } = task; | ||
@@ -71,3 +72,3 @@ const now = scheduler.now; | ||
const task = scheduler.queue.pop(); | ||
const hasCurrent = task !== undefined; | ||
const hasCurrent = option_1.isSome(task); | ||
scheduler.current = task; | ||
@@ -82,3 +83,3 @@ scheduler.hasCurrent = hasCurrent; | ||
const task = delayed.peek(); | ||
if (task === undefined) { | ||
if (option_1.isNone(task)) { | ||
break; | ||
@@ -95,6 +96,6 @@ } | ||
} | ||
let task = undefined; | ||
let task = option_1.none; | ||
while (true) { | ||
task = queue.peek(); | ||
if (task === undefined) { | ||
if (option_1.isNone(task)) { | ||
break; | ||
@@ -108,21 +109,17 @@ } | ||
} | ||
return task || delayed.peek(); | ||
return task !== null && task !== void 0 ? task : delayed.peek(); | ||
}; | ||
class PrioritySchedulerResourceImpl { | ||
class PrioritySchedulerImpl extends disposable_1.AbstractSerialDisposable { | ||
constructor(hostScheduler) { | ||
super(); | ||
this.hostScheduler = hostScheduler; | ||
this.add = disposable_1.add; | ||
this.disposable = disposable_1.createSerialDisposable().add(() => this.queue.clear()); | ||
this.dispose = disposable_1.dispose; | ||
this.inContinuation = false; | ||
this.queue = priorityQueue_1.createPriorityQueue(comparator); | ||
this.delayed = priorityQueue_1.createPriorityQueue(delayedComparator); | ||
this.current = undefined; | ||
this.queue = collections_1.createPriorityQueue(comparator); | ||
this.delayed = collections_1.createPriorityQueue(delayedComparator); | ||
this.current = option_1.none; | ||
this.hasCurrent = false; | ||
this.taskIDCounter = 0; | ||
this.dueTime = 0; | ||
this.add(() => this.queue.clear()); | ||
} | ||
get isDisposed() { | ||
return this.disposable.isDisposed; | ||
} | ||
get now() { | ||
@@ -147,7 +144,7 @@ return this.hostScheduler.now; | ||
const continuationActive = this.inContinuation || | ||
(!this.disposable.inner.isDisposed && this.dueTime <= dueTime); | ||
(!this.inner.isDisposed && this.dueTime <= dueTime); | ||
if (head === task && !continuationActive) { | ||
const continuation = new PrioritySchedulerContinuation(this); | ||
this.dueTime = dueTime; | ||
this.disposable.inner = continuation; | ||
this.inner = continuation; | ||
this.hostScheduler.schedule(continuation, delay); | ||
@@ -158,3 +155,3 @@ } | ||
} | ||
exports.createPriorityScheduler = (hostScheduler) => new PrioritySchedulerResourceImpl(hostScheduler); | ||
exports.createPriorityScheduler = (hostScheduler) => new PrioritySchedulerImpl(hostScheduler); | ||
//# sourceMappingURL=priorityScheduler.js.map |
@@ -1,2 +0,2 @@ | ||
import { SchedulerContinuationLike, HostSchedulerLike } from "./interfaces"; | ||
export declare function schedule(this: HostSchedulerLike, continuation: SchedulerContinuationLike, delay?: number): void; | ||
import { SchedulerContinuationLike, CallbackSchedulerLike } from "./interfaces"; | ||
export declare function schedule(this: CallbackSchedulerLike, continuation: SchedulerContinuationLike, delay?: number): void; |
@@ -1,3 +0,3 @@ | ||
import { OperatorLike } from "@reactive-js/pipe"; | ||
import { Operator } from "@reactive-js/pipe"; | ||
import { SchedulerLike, PrioritySchedulerLike } from "./interfaces"; | ||
export declare const toSchedulerWithPriority: (priority: number) => OperatorLike<PrioritySchedulerLike, SchedulerLike>; | ||
export declare const toSchedulerWithPriority: (priority: number) => Operator<PrioritySchedulerLike, SchedulerLike>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const priorityQueue_1 = require("./priorityQueue"); | ||
const collections_1 = require("@reactive-js/collections"); | ||
const option_1 = require("@reactive-js/option"); | ||
const abstractSchedulerContinuation_1 = require("./abstractSchedulerContinuation"); | ||
@@ -16,3 +17,3 @@ const comparator = (a, b) => { | ||
const task = taskQueue.pop(); | ||
if (task !== undefined) { | ||
if (option_1.isSome(task)) { | ||
const { dueTime, continuation } = task; | ||
@@ -34,3 +35,3 @@ scheduler.current = continuation; | ||
this.maxMicroTaskTicks = maxMicroTaskTicks; | ||
this.current = undefined; | ||
this.current = option_1.none; | ||
this.hasCurrent = false; | ||
@@ -44,13 +45,13 @@ this.inContinuation = false; | ||
return (this.microTaskTicks >= this.maxMicroTaskTicks || | ||
(runShouldYield !== undefined && runShouldYield())); | ||
(option_1.isSome(runShouldYield) && runShouldYield())); | ||
}; | ||
this.taskIDCount = 0; | ||
this.taskQueue = priorityQueue_1.createPriorityQueue(comparator); | ||
this.taskQueue = collections_1.createPriorityQueue(comparator); | ||
} | ||
produce(hostShouldYield) { | ||
const hostShouldYieldIsDefined = hostShouldYield !== undefined; | ||
const hostShouldYieldIsDefined = option_1.isSome(hostShouldYield); | ||
this.hostShouldYield = hostShouldYield; | ||
if (this.maxMicroTaskTicks === Number.MAX_SAFE_INTEGER && | ||
!hostShouldYieldIsDefined) { | ||
this.shouldYield = undefined; | ||
this.shouldYield = option_1.none; | ||
} | ||
@@ -67,3 +68,3 @@ while (move(this)) { | ||
if (hostShouldYield()) { | ||
this.hostShouldYield = undefined; | ||
this.hostShouldYield = option_1.none; | ||
return 0; | ||
@@ -73,3 +74,3 @@ } | ||
} | ||
this.hostShouldYield = undefined; | ||
this.hostShouldYield = option_1.none; | ||
return -1; | ||
@@ -76,0 +77,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export { SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, PrioritySchedulerLike, HostSchedulerLike, } from "./internal/interfaces"; | ||
export { SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, PrioritySchedulerLike, CallbackSchedulerLike, } from "./internal/interfaces"; | ||
export { AbstractSchedulerContinuation } from "./internal/abstractSchedulerContinuation"; | ||
@@ -3,0 +3,0 @@ export { createPriorityScheduler } from "./internal/priorityScheduler"; |
@@ -1,14 +0,11 @@ | ||
import { add, dispose } from "@reactive-js/disposable"; | ||
import { AbstractDisposable } from "@reactive-js/disposable"; | ||
import { SchedulerContinuationLike, SchedulerContinuationRunStatusChangedListenerLike } from "./interfaces"; | ||
export declare abstract class AbstractSchedulerContinuation implements SchedulerContinuationLike { | ||
readonly add: typeof add; | ||
export declare abstract class AbstractSchedulerContinuation extends AbstractDisposable implements SchedulerContinuationLike { | ||
private isActive; | ||
readonly disposable: import("@reactive-js/disposable").DisposableLike; | ||
readonly dispose: typeof dispose; | ||
private readonly listeners; | ||
constructor(); | ||
addListener(_ev: "onRunStatusChanged", listener: SchedulerContinuationRunStatusChangedListenerLike): void; | ||
removeListener(_ev: "onRunStatusChanged", listener: SchedulerContinuationRunStatusChangedListenerLike): void; | ||
get isDisposed(): boolean; | ||
abstract produce(shouldYield?: () => boolean): number; | ||
run(shouldYield?: () => boolean): number; | ||
} |
@@ -1,2 +0,3 @@ | ||
import { add, createDisposable, dispose, } from "@reactive-js/disposable"; | ||
import { AbstractDisposable } from "@reactive-js/disposable"; | ||
import { none, isSome } from "@reactive-js/option"; | ||
const notifyListeners = (listeners, state) => { | ||
@@ -7,7 +8,8 @@ for (const listener of listeners) { | ||
}; | ||
export class AbstractSchedulerContinuation { | ||
export class AbstractSchedulerContinuation extends AbstractDisposable { | ||
constructor() { | ||
this.add = add; | ||
super(); | ||
this.isActive = false; | ||
this.disposable = createDisposable(() => { | ||
this.listeners = new Set(); | ||
this.add(() => { | ||
if (!this.isActive) { | ||
@@ -17,4 +19,2 @@ this.listeners.clear(); | ||
}); | ||
this.dispose = dispose; | ||
this.listeners = new Set(); | ||
} | ||
@@ -29,9 +29,6 @@ addListener(_ev, listener) { | ||
} | ||
get isDisposed() { | ||
return this.disposable.isDisposed; | ||
} | ||
run(shouldYield) { | ||
const listeners = this.listeners; | ||
let result = -1; | ||
let error = undefined; | ||
let error = none; | ||
if (!this.isDisposed) { | ||
@@ -50,3 +47,3 @@ this.isActive = true; | ||
const isDisposed = this.isDisposed; | ||
if (!isDisposed && error !== undefined) { | ||
if (!isDisposed && isSome(error)) { | ||
this.dispose(error); | ||
@@ -53,0 +50,0 @@ } |
import { DisposableLike } from "@reactive-js/disposable"; | ||
import { Option } from "@reactive-js/option"; | ||
export interface SchedulerContinuationRunStatusChangedListenerLike { | ||
@@ -22,6 +23,6 @@ onRunStatusChanged(state: boolean): void; | ||
} | ||
export interface HostSchedulerLike extends SchedulerLike { | ||
export interface CallbackSchedulerLike extends SchedulerLike { | ||
inContinuation: boolean; | ||
readonly shouldYield: (() => boolean) | undefined; | ||
readonly shouldYield: Option<() => boolean>; | ||
scheduleCallback(callback: () => void, delay: number): DisposableLike; | ||
} |
@@ -1,3 +0,4 @@ | ||
import { add, dispose, createSerialDisposable, } from "@reactive-js/disposable"; | ||
import { createPriorityQueue } from "./priorityQueue"; | ||
import { createPriorityQueue, } from "@reactive-js/collections"; | ||
import { AbstractSerialDisposable, } from "@reactive-js/disposable"; | ||
import { none, isSome, isNone } from "@reactive-js/option"; | ||
import { AbstractSchedulerContinuation } from "./abstractSchedulerContinuation"; | ||
@@ -14,4 +15,4 @@ const alwaysFalse = () => false; | ||
const next = peek(scheduler); | ||
const nextTaskIsHigherPriority = current !== undefined && | ||
next !== undefined && | ||
const nextTaskIsHigherPriority = isSome(current) && | ||
isSome(next) && | ||
current !== next && | ||
@@ -24,6 +25,6 @@ next.dueTime <= scheduler.now && | ||
produce(hostShouldYield) { | ||
this.hostShouldYield = hostShouldYield || alwaysFalse; | ||
this.hostShouldYield = hostShouldYield !== null && hostShouldYield !== void 0 ? hostShouldYield : alwaysFalse; | ||
const { scheduler } = this; | ||
const { delayed, queue } = scheduler; | ||
for (let task = peek(scheduler), isDisposed = this.isDisposed; task !== undefined && !isDisposed; task = peek(scheduler)) { | ||
for (let task = peek(scheduler), isDisposed = this.isDisposed; isSome(task) && !isDisposed; task = peek(scheduler)) { | ||
const { continuation, dueTime } = task; | ||
@@ -69,3 +70,3 @@ const now = scheduler.now; | ||
const task = scheduler.queue.pop(); | ||
const hasCurrent = task !== undefined; | ||
const hasCurrent = isSome(task); | ||
scheduler.current = task; | ||
@@ -80,3 +81,3 @@ scheduler.hasCurrent = hasCurrent; | ||
const task = delayed.peek(); | ||
if (task === undefined) { | ||
if (isNone(task)) { | ||
break; | ||
@@ -93,6 +94,6 @@ } | ||
} | ||
let task = undefined; | ||
let task = none; | ||
while (true) { | ||
task = queue.peek(); | ||
if (task === undefined) { | ||
if (isNone(task)) { | ||
break; | ||
@@ -106,21 +107,17 @@ } | ||
} | ||
return task || delayed.peek(); | ||
return task !== null && task !== void 0 ? task : delayed.peek(); | ||
}; | ||
class PrioritySchedulerResourceImpl { | ||
class PrioritySchedulerImpl extends AbstractSerialDisposable { | ||
constructor(hostScheduler) { | ||
super(); | ||
this.hostScheduler = hostScheduler; | ||
this.add = add; | ||
this.disposable = createSerialDisposable().add(() => this.queue.clear()); | ||
this.dispose = dispose; | ||
this.inContinuation = false; | ||
this.queue = createPriorityQueue(comparator); | ||
this.delayed = createPriorityQueue(delayedComparator); | ||
this.current = undefined; | ||
this.current = none; | ||
this.hasCurrent = false; | ||
this.taskIDCounter = 0; | ||
this.dueTime = 0; | ||
this.add(() => this.queue.clear()); | ||
} | ||
get isDisposed() { | ||
return this.disposable.isDisposed; | ||
} | ||
get now() { | ||
@@ -145,7 +142,7 @@ return this.hostScheduler.now; | ||
const continuationActive = this.inContinuation || | ||
(!this.disposable.inner.isDisposed && this.dueTime <= dueTime); | ||
(!this.inner.isDisposed && this.dueTime <= dueTime); | ||
if (head === task && !continuationActive) { | ||
const continuation = new PrioritySchedulerContinuation(this); | ||
this.dueTime = dueTime; | ||
this.disposable.inner = continuation; | ||
this.inner = continuation; | ||
this.hostScheduler.schedule(continuation, delay); | ||
@@ -156,3 +153,3 @@ } | ||
} | ||
export const createPriorityScheduler = (hostScheduler) => new PrioritySchedulerResourceImpl(hostScheduler); | ||
export const createPriorityScheduler = (hostScheduler) => new PrioritySchedulerImpl(hostScheduler); | ||
//# sourceMappingURL=priorityScheduler.js.map |
@@ -1,2 +0,2 @@ | ||
import { SchedulerContinuationLike, HostSchedulerLike } from "./interfaces"; | ||
export declare function schedule(this: HostSchedulerLike, continuation: SchedulerContinuationLike, delay?: number): void; | ||
import { SchedulerContinuationLike, CallbackSchedulerLike } from "./interfaces"; | ||
export declare function schedule(this: CallbackSchedulerLike, continuation: SchedulerContinuationLike, delay?: number): void; |
@@ -1,3 +0,3 @@ | ||
import { OperatorLike } from "@reactive-js/pipe"; | ||
import { Operator } from "@reactive-js/pipe"; | ||
import { SchedulerLike, PrioritySchedulerLike } from "./interfaces"; | ||
export declare const toSchedulerWithPriority: (priority: number) => OperatorLike<PrioritySchedulerLike, SchedulerLike>; | ||
export declare const toSchedulerWithPriority: (priority: number) => Operator<PrioritySchedulerLike, SchedulerLike>; |
@@ -1,2 +0,3 @@ | ||
import { createPriorityQueue } from "./priorityQueue"; | ||
import { createPriorityQueue, } from "@reactive-js/collections"; | ||
import { none, isSome } from "@reactive-js/option"; | ||
import { AbstractSchedulerContinuation } from "./abstractSchedulerContinuation"; | ||
@@ -14,3 +15,3 @@ const comparator = (a, b) => { | ||
const task = taskQueue.pop(); | ||
if (task !== undefined) { | ||
if (isSome(task)) { | ||
const { dueTime, continuation } = task; | ||
@@ -32,3 +33,3 @@ scheduler.current = continuation; | ||
this.maxMicroTaskTicks = maxMicroTaskTicks; | ||
this.current = undefined; | ||
this.current = none; | ||
this.hasCurrent = false; | ||
@@ -42,3 +43,3 @@ this.inContinuation = false; | ||
return (this.microTaskTicks >= this.maxMicroTaskTicks || | ||
(runShouldYield !== undefined && runShouldYield())); | ||
(isSome(runShouldYield) && runShouldYield())); | ||
}; | ||
@@ -49,7 +50,7 @@ this.taskIDCount = 0; | ||
produce(hostShouldYield) { | ||
const hostShouldYieldIsDefined = hostShouldYield !== undefined; | ||
const hostShouldYieldIsDefined = isSome(hostShouldYield); | ||
this.hostShouldYield = hostShouldYield; | ||
if (this.maxMicroTaskTicks === Number.MAX_SAFE_INTEGER && | ||
!hostShouldYieldIsDefined) { | ||
this.shouldYield = undefined; | ||
this.shouldYield = none; | ||
} | ||
@@ -66,3 +67,3 @@ while (move(this)) { | ||
if (hostShouldYield()) { | ||
this.hostShouldYield = undefined; | ||
this.hostShouldYield = none; | ||
return 0; | ||
@@ -72,3 +73,3 @@ } | ||
} | ||
this.hostShouldYield = undefined; | ||
this.hostShouldYield = none; | ||
return -1; | ||
@@ -75,0 +76,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export { SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, PrioritySchedulerLike, HostSchedulerLike, } from "./internal/interfaces"; | ||
export { SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, PrioritySchedulerLike, CallbackSchedulerLike, } from "./internal/interfaces"; | ||
export { AbstractSchedulerContinuation } from "./internal/abstractSchedulerContinuation"; | ||
@@ -3,0 +3,0 @@ export { createPriorityScheduler } from "./internal/priorityScheduler"; |
@@ -1,12 +0,9 @@ | ||
import { add, dispose } from "@reactive-js/disposable"; | ||
import { AbstractDisposable } from "@reactive-js/disposable"; | ||
import { SchedulerContinuationLike, SchedulerContinuationRunStatusChangedListenerLike } from "./interfaces"; | ||
export declare abstract class AbstractSchedulerContinuation implements SchedulerContinuationLike { | ||
readonly add: typeof add; | ||
export declare abstract class AbstractSchedulerContinuation extends AbstractDisposable implements SchedulerContinuationLike { | ||
private isActive; | ||
readonly disposable: import("@reactive-js/disposable").DisposableLike; | ||
readonly dispose: typeof dispose; | ||
private readonly listeners; | ||
constructor(); | ||
addListener(_ev: "onRunStatusChanged", listener: SchedulerContinuationRunStatusChangedListenerLike): void; | ||
removeListener(_ev: "onRunStatusChanged", listener: SchedulerContinuationRunStatusChangedListenerLike): void; | ||
get isDisposed(): boolean; | ||
abstract produce(shouldYield?: () => boolean): number; | ||
@@ -13,0 +10,0 @@ run(shouldYield?: () => boolean): number; |
import { DisposableLike } from "@reactive-js/disposable"; | ||
import { Option } from "@reactive-js/option"; | ||
export interface SchedulerContinuationRunStatusChangedListenerLike { | ||
@@ -22,7 +23,7 @@ onRunStatusChanged(state: boolean): void; | ||
} | ||
export interface HostSchedulerLike extends SchedulerLike { | ||
export interface CallbackSchedulerLike extends SchedulerLike { | ||
inContinuation: boolean; | ||
readonly shouldYield: (() => boolean) | undefined; | ||
readonly shouldYield: Option<() => boolean>; | ||
scheduleCallback(callback: () => void, delay: number): DisposableLike; | ||
} | ||
//# sourceMappingURL=interfaces.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { SchedulerContinuationLike, HostSchedulerLike } from "./interfaces"; | ||
export declare function schedule(this: HostSchedulerLike, continuation: SchedulerContinuationLike, delay?: number): void; | ||
import { SchedulerContinuationLike, CallbackSchedulerLike } from "./interfaces"; | ||
export declare function schedule(this: CallbackSchedulerLike, continuation: SchedulerContinuationLike, delay?: number): void; | ||
//# sourceMappingURL=schedulerMixin.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { OperatorLike } from "@reactive-js/pipe"; | ||
import { Operator } from "@reactive-js/pipe"; | ||
import { SchedulerLike, PrioritySchedulerLike } from "./interfaces"; | ||
export declare const toSchedulerWithPriority: (priority: number) => OperatorLike<PrioritySchedulerLike, SchedulerLike>; | ||
export declare const toSchedulerWithPriority: (priority: number) => Operator<PrioritySchedulerLike, SchedulerLike>; | ||
//# sourceMappingURL=schedulerWithPriority.d.ts.map |
{ | ||
"name": "@reactive-js/scheduler", | ||
"version": "0.0.33", | ||
"version": "0.0.34", | ||
"main": "dist/cjs/index.js", | ||
@@ -41,4 +41,6 @@ "module": "dist/esm5/index.js", | ||
"dependencies": { | ||
"@reactive-js/disposable": "^0.0.33", | ||
"@reactive-js/pipe": "^0.0.33" | ||
"@reactive-js/collections": "^0.0.34", | ||
"@reactive-js/disposable": "^0.0.34", | ||
"@reactive-js/option": "^0.0.34", | ||
"@reactive-js/pipe": "^0.0.34" | ||
}, | ||
@@ -70,3 +72,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "1c5eece990f7e48fce3f8510f74a5204fc69c4b5" | ||
"gitHead": "057b4a00c7069f12169d6f8a406d140769c1a349" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
69126
4
67
878
+ Added@reactive-js/option@^0.0.34
+ Added@reactive-js/collections@0.0.34(transitive)
+ Added@reactive-js/disposable@0.0.34(transitive)
+ Added@reactive-js/enumerable@0.0.34(transitive)
+ Added@reactive-js/option@0.0.34(transitive)
+ Added@reactive-js/pipe@0.0.34(transitive)
- Removed@reactive-js/disposable@0.0.33(transitive)
- Removed@reactive-js/pipe@0.0.33(transitive)
Updated@reactive-js/pipe@^0.0.34