Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.7/dist/global/Rx.umd.js"></script>
</body>
</html>
 
var arrayOfStreamsStream = Rx.Observable
.of(
  [],
  [
   Rx.Observable.of('blah-1'), // component state.
   Rx.Observable.of('blah-2'),
   Rx.Observable.of('blah-3')
  ],
  [],
  [
   Rx.Observable.of('foo-1'),
   Rx.Observable.of('qux-2')
  ]
)
.map(function onMap(coll) {
  coll.push(Rx.Observable.of('END_OF_STATE_DATA'))
  return coll
})
.switchMap(function onMap(coll) {
  return Rx.Observable
  .from(coll)
  .combineAll()
})
.subscribe(function onSubscribe(data) {
  console.log('onSubscribe START')
  console.dir(data)
  console.log('onSubscribe END')
})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
marcusnielsenpro
0viewers