made with esnextbin
Created
July 16, 2016 07:25
-
-
Save trxcllnt/670494756cb702f18b8d5a68e2abbee3 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"rxjs": "5.0.0-beta.10" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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