I am trying to convert my promise based code to RxJs but have a hard time to get my head around Rx especially RxJs.
I have a an array with paths.
var paths = ["imagePath1","imagePath2"];
And I like to load images in Javascript
var img = new Image();
img.src = imagePath;
image.onload // <- when this callback fires I'll add them to the images array
and when all Images are loaded I like to execute a method on.
I know there is
Rx.Observable.fromArray(imagepathes)
there is also something like
Rx.Observable.fromCallback(...)
and there is something like flatMapLatest(...)
And Rx.Observable.interval
or timebased scheduler
Based on my research I would assume that these would be the ingredients to solve it but I cannot get the composition to work.
So how do I load images from a array paths and when all images are loaded I execute a method based on an interval?
Thanks for any help.