|
@@ -121,8 +121,6 @@ function understandingOBS() {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-understandingOBS()
|
|
|
|
-
|
|
|
|
/* Buffer */
|
|
/* Buffer */
|
|
function bufferOBS() {
|
|
function bufferOBS() {
|
|
/* This code defines a function called bufferOBS that creates a new observable called bufferring using
|
|
/* This code defines a function called bufferOBS that creates a new observable called bufferring using
|
|
@@ -181,11 +179,10 @@ function bufferWhenOBS() {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-bufferWhenOBS()
|
|
|
|
-
|
|
|
|
/* Scheduler */
|
|
/* Scheduler */
|
|
function asyncScheduleOBS() {
|
|
function asyncScheduleOBS() {
|
|
- const scheduleObservable = of(`Hello Observable passing through`)
|
|
|
|
|
|
+ // const scheduleObservable = of(`Hello Observable passing through`)
|
|
|
|
+ const scheduleObservable = interval(1000)
|
|
const delayTime = 3000;
|
|
const delayTime = 3000;
|
|
/* In this example, the source$ observable emits the value "Hello Observable passing through". We pass the source$ observable\
|
|
/* In this example, the source$ observable emits the value "Hello Observable passing through". We pass the source$ observable\
|
|
as a parameter to the task function, which is executed after a delay of 3 second using the asyncScheduler.
|
|
as a parameter to the task function, which is executed after a delay of 3 second using the asyncScheduler.
|
|
@@ -198,6 +195,8 @@ function asyncScheduleOBS() {
|
|
}, delayTime);
|
|
}, delayTime);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+asyncScheduleOBS()
|
|
|
|
+
|
|
function queue_Scheduler() {
|
|
function queue_Scheduler() {
|
|
/* In this example, we use the observeOn operator to apply the queueScheduler to the observable stream.
|
|
/* In this example, we use the observeOn operator to apply the queueScheduler to the observable stream.
|
|
We then subscribe to the stream and execute three tasks (task1, task2, and task3) in order using the queueScheduler.
|
|
We then subscribe to the stream and execute three tasks (task1, task2, and task3) in order using the queueScheduler.
|