Skip to content

Instantly share code, notes, and snippets.

@trxcllnt
Created July 16, 2016 07:25
Show Gist options
  • Save trxcllnt/670494756cb702f18b8d5a68e2abbee3 to your computer and use it in GitHub Desktop.
Save trxcllnt/670494756cb702f18b8d5a68e2abbee3 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
<div id="app"></div>
</body>
</html>
import { Observable } from 'rxjs';
const throwsImmediately = Observable.create(() => {
throw new Error('oops');
});
try {
throwsImmediately.subscribe({
error: _ => console.log('got it')
});
} catch (e) {
console.log(`got it: ${e.message}`);
}
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"rxjs": "5.0.0-beta.10"
}
}
'use strict';
var _rxjs = require('rxjs');
var throwsImmediately = _rxjs.Observable.create(function () {
throw new Error('oops');
});
try {
throwsImmediately.subscribe({
error: function error(_) {
return console.log('got it');
}
});
} catch (e) {
console.log('got it: ' + e.message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment