- Mastering Reactive JavaScript
- Erich de Souza Oliveira
- 58字
- 2021-07-09 20:33:07
Observables from an array (sequentially)
To create an observable from an array with a given interval to deliver each item from the array, we can use the sequentially() method, as follows:
var myArray = [1,2,3];
var intervalBetweenItens = 100;
Bacon
.sequentially(intervalBetweenItens ,myArray);
This code emits the itens of the array with 100 milliseconds of interval between each emission.