demos/03-concurrent-fruit.js
function simulatedUserInput(numArray) {
    // pause + first one
    // forEach after the first: outer + inner
    const rest$ = numOrArray => {
      if (!numOrArray.length) return after(pause, () => numOrArray)
      let rest = after(pause, () => numOrArray[0])
      for (let i = 1; i < numOrArray.length; i++) {
        rest = concat(rest, after(outer, () => numOrArray[i]))
      }
      return rest
    }

    return from(numArray).pipe(concatMap(rest$))
  }
function simulatedUserInput(numArray) {
    // pause + first one
    // forEach after the first: outer + inner
    const rest$ = numOrArray => {
      if (!numOrArray.length) return after(pause, () => numOrArray)
      let rest = after(pause, () => numOrArray[0])
      for (let i = 1; i < numOrArray.length; i++) {
        rest = concat(rest, after(outer, () => numOrArray[i]))
      }
      return rest
    }

    return from(numArray).pipe(concatMap(rest$))
  }
function simulatedUserInput ( numArray ) { // pause + first one // forEach after the first: outer + inner const rest$ = numOrArray => { if ( ! numOrArray . length ) return after ( pause , ( ) => numOrArray ) let rest = after ( pause , ( ) => numOrArray [ 0 ] ) for ( let i = 1 ; i < numOrArray . length ; i ++ ) { rest = concat ( rest , after ( outer , ( ) => numOrArray [ i ] ) ) } return rest } return from ( numArray ) . pipe ( concatMap ( rest$ ) ) }
an observable of numbers every second
an observable of numbers every second