I want to send a bulk of data and after completing it, want to move to the next one. For example: I have this function:
async function test() {
await sample.sampleStructure()
await sample.sampleDataAdd()
await sample.sampleDataGet()
}
Where I am calling the 3 functions for each call. But I wanted to send for example 200 data for await sample.sampleDataAdd()
and if the first 200 data response is 'Success' then it will send the rest of the 200 datas. After completing 1000 datas, I want to move on to the next function call.
So I looked and I think RXJS can provide the solution. But I am not use if is it possible to use the filter and next for this scenario.
async function test() {
await sample.sampleStructure()
// let observable = Observable.range(1,1000)
let observable = Observable.create()
observable
.filter(aysnc function () {
await sample.sampleDataAdd()
})
.subscribe({
.next: async function () {
// await sample.sampleDataAdd()
},
.error: function (error) {
console.log(error)
}
})
I am very new at rxjs, so there are lots of mistakes as well. Please can anyone help me regarding this matter ?