Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
      var parent = Rx.Observable.from([1,2,3]).publish();
      var child = parent.map(x => x).publish();
      var groupedParent = parent.groupBy(x => x);
      var groupedChild = child.groupBy(x => x);
      Rx.Observable.zip([groupedParent, groupedChild])
        .subscribe(groups => {
          groups[0].subscribe(x => console.log('zipped parent ' + x));
          groups[1].subscribe(x => console.log('zipped child ' + x));
        });
      groupedChild.subscribe(group => {
        group.subscribe(value => console.log('child ' + value));
      });
      groupedParent.subscribe(group => {
        group.subscribe(value => console.log('parent ' + value));
      });
      child.connect();
      parent.connect();
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers