made with esnextbin
Created
April 18, 2016 19:30
-
-
Save davidchase/f9a4f3202bbd3b6dceacfe4c14e8e61d to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or 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 --> | |
</body> | |
</html> |
This file contains hidden or 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 most from 'most' | |
const patchy = new Promise((res, rej) => rej('PATCH ERR')) | |
const posty = new Promise((res, rej) => res('POST RESULT')) | |
most.fromPromise(patchy) | |
.recoverWith(function(err){ | |
return most.fromPromise(posty); | |
}) | |
.observe(console.info.bind(console)) |
This file contains hidden or 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": { | |
"most": "0.18.8", | |
"babel-runtime": "6.6.1" | |
} | |
} |
This file contains hidden or 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 _promise = require('babel-runtime/core-js/promise'); | |
var _promise2 = _interopRequireDefault(_promise); | |
var _most = require('most'); | |
var _most2 = _interopRequireDefault(_most); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var patchy = new _promise2.default(function (res, rej) { | |
return rej('PATCH ERR'); | |
}); | |
var posty = new _promise2.default(function (res, rej) { | |
return res('POST RESULT'); | |
}); | |
_most2.default.fromPromise(patchy).recoverWith(function (err) { | |
return _most2.default.fromPromise(posty); | |
}).observe(console.info.bind(console)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment