@reactive-js/core
Advanced tools
Comparing version 0.0.39 to 0.0.40
@@ -84,5 +84,3 @@ "use strict"; | ||
observer.notify(next); | ||
if (delay > 0 || observer.shouldYield) { | ||
scheduler_1.yield$(delay); | ||
} | ||
scheduler_1.yield$(observer, delay); | ||
}; |
@@ -33,3 +33,3 @@ "use strict"; | ||
this.inContinuation = true; | ||
scheduler_1.continue$(continuation); | ||
scheduler_1.run(continuation); | ||
this.inContinuation = false; | ||
@@ -36,0 +36,0 @@ const error = this.error; |
@@ -52,3 +52,3 @@ "use strict"; | ||
scheduler.startTime = scheduler.now; | ||
schedulerContinuation_1.continue$(continuation); | ||
schedulerContinuation_1.run(continuation); | ||
scheduler.inContinuation = false; | ||
@@ -55,0 +55,0 @@ } |
@@ -67,3 +67,3 @@ "use strict"; | ||
this.host = host; | ||
this.continuation = () => { | ||
this.continuation = (host) => { | ||
for (let task = peek(this); option_1.isSome(task) && !this.isDisposed; task = peek(this)) { | ||
@@ -75,8 +75,6 @@ const { continuation, dueTime } = task; | ||
this.inContinuation = true; | ||
schedulerContinuation_1.continue$(continuation); | ||
schedulerContinuation_1.run(continuation); | ||
this.inContinuation = false; | ||
} | ||
if (delay > 0 || this.host.shouldYield) { | ||
schedulerContinuation_1.yield$(delay); | ||
} | ||
schedulerContinuation_1.yield$(host, delay); | ||
} | ||
@@ -83,0 +81,0 @@ }; |
import { DisposableLike } from "../../disposable"; | ||
import { SideEffect1 } from "../../functions"; | ||
import { SchedulerContinuationLike, SchedulerLike } from "./interfaces"; | ||
export declare const continue$: (continuation: SchedulerContinuationLike) => void; | ||
export declare const yield$: (delay: number) => never; | ||
export declare const run: (continuation: SchedulerContinuationLike) => void; | ||
export declare const yield$: (scheduler: SchedulerLike, delay: number) => void; | ||
export declare const schedule: <T extends SchedulerLike>(scheduler: T, f: SideEffect1<T>, options?: { | ||
delay: number; | ||
}) => DisposableLike; |
@@ -61,7 +61,9 @@ "use strict"; | ||
} | ||
exports.continue$ = (continuation) => { | ||
exports.run = (continuation) => { | ||
continuation.continue(); | ||
}; | ||
exports.yield$ = (delay) => { | ||
throw new YieldError(delay); | ||
exports.yield$ = (scheduler, delay) => { | ||
if (delay > 0 || scheduler.shouldYield) { | ||
throw new YieldError(delay); | ||
} | ||
}; | ||
@@ -68,0 +70,0 @@ exports.schedule = (scheduler, f, options = { delay: 0 }) => { |
@@ -50,3 +50,3 @@ "use strict"; | ||
this.inContinuation = true; | ||
schedulerContinuation_1.continue$(this.current); | ||
schedulerContinuation_1.run(this.current); | ||
this.inContinuation = false; | ||
@@ -53,0 +53,0 @@ } |
export { PausableSchedulerLike, PrioritySchedulerLike, SchedulerContinuationRunStatusChangedListenerLike, SchedulerContinuationLike, SchedulerLike, VirtualTimeSchedulerLike, } from "./internal/scheduler/interfaces"; | ||
export { toPriorityScheduler, toPausableScheduler, } from "./internal/scheduler/priorityQueueScheduler"; | ||
export { continue$, schedule, yield$, } from "./internal/scheduler/schedulerContinuation"; | ||
export { run, schedule, yield$, } from "./internal/scheduler/schedulerContinuation"; | ||
export { toSchedulerWithPriority } from "./internal/scheduler/schedulerWithPriority"; | ||
export { createHostScheduler } from "./internal/scheduler/hostScheduler"; | ||
export { createVirtualTimeScheduler } from "./internal/scheduler/virtualTimeScheduler"; |
@@ -7,3 +7,3 @@ "use strict"; | ||
var schedulerContinuation_1 = require("./internal/scheduler/schedulerContinuation"); | ||
exports.continue$ = schedulerContinuation_1.continue$; | ||
exports.run = schedulerContinuation_1.run; | ||
exports.schedule = schedulerContinuation_1.schedule; | ||
@@ -10,0 +10,0 @@ exports.yield$ = schedulerContinuation_1.yield$; |
{ | ||
"name": "@reactive-js/core", | ||
"version": "0.0.39", | ||
"version": "0.0.40", | ||
"keywords": [ | ||
@@ -94,3 +94,3 @@ "asynchronous", | ||
}, | ||
"gitHead": "a6c0ab3344e0aeeb8ae1ef38153be8eb5dc09560" | ||
"gitHead": "7fecdcd629c213cb934caa95cee10d109fd53bc9" | ||
} |
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
463639
10946