Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script>
  <title>JS Bin</title>
  <script src="//cdn.jsdelivr.net/rsvp/3.0.6/rsvp.js"></script>
</head>
<body>
</body>
</html>
 
/* Using Observables */
var array = [1, 2, 3];
var source = Rx.Observable.for(
    array,
    x => Rx.Observable.returnValue(x)
);
var subscription = source.subscribe(
  x => console.log(`onNext: ${x}`),
  e => console.log(`onError: ${e}`),
  () => console.log('onCompleted'));
// => onNext: 1
// => onNext: 2
// => onNext: 3
// => onCompleted
Output

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

Dismiss x