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://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script>
</body>
</html>
 
const Observable = Rx.Observable;
let num = 0;
let myObs = Observable.of(1);
let content = ['x','y','z'];
const gen = (num: number): Observable<any> => {
  return Observable.of(num * num);
}
myObs
  .expand(()=>{
  return gen(num);
})
.skip(1)
.take(content.length)
.subscribe(x=>console.log(x));
Output 300px

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

Dismiss x
public
Bin info
cozyazurepro
0viewers