Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <!--<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script>-->
  <script src="https://unpkg.com/@reactivex/rxjs@5.4.3/dist/global/Rx.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
console.clear();
const input$ = new Rx.Subject();
input$
  .switchMap(() => Rx.Observable.of(1))
  .subscribe(d => {
     throw new Error('will throw (1)');    
  });
input$.next();
const input2$ = new Rx.Subject();
input2$
  .switchMap(() => Rx.Observable.of(1, 2))
  .subscribe(d => {
     throw new Error('will not throw (1)');    
  });
input2$.next();
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers