<!DOCTYPE html>
<html>
<head>
<script data-require="rxjs@5.0.0-beta.7" data-semver="5.0.0-beta.7" src="https://npmcdn.com/rxjs@5.0.0-beta.7/bundles/Rx.umd.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<h1>Create Observable</h1>
</body>
</html>
// Code goes here
var observable = Rx.Observable.create(function (observer) {
observer.next(1);
observer.next(2);
setTimeout(() => {
observer.next(3);
observer.complete();
}, 2000);
});
console.log('before subscription');
observable.subscribe(
(x) => console.log('got value ' + x),
(err) => console.error('something wrong occurred: ' + err),
() => console.log('done')
);
console.log('after subscription');
/* Styles go here */