Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.7/dist/global/Rx.umd.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var Observable = Rx.Observable;
var source1 = Observable.create(function(observer){
    observer.error();
});
var source2 = Observable.create(function(observer){
    observer.next('Continuing on');
    observer.complete();
});
var stream = source1.catch(function(data){
  return source2;
});
stream.subscribe(function(data){
  console.log(data);
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers