made with esnextbin
Created
October 7, 2016 18:22
-
-
Save davidchase/eff7c469d3208e3c86438b487b9e1903 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 {task, runTask} from '@briancavalier/yet' | |
const url ='https://gist.githubusercontent.com/samgiles/762ee337dff48623e729/raw/802750cbee7d0303b2dd6f383ab17d48d397f804/flatMap.js' | |
const t = task(resolve => fetch(url).then(resolve)) | |
const [kill, futureValue] = runTask(t) | |
futureValue.map(resp => resp.text).map(console.log) |
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": { | |
"@briancavalier/yet": "1.0.0", | |
"babel-runtime": "6.11.6" | |
} | |
} |
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 _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | |
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | |
var _yet = require('@briancavalier/yet'); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var url = 'https://gist.githubusercontent.com/samgiles/762ee337dff48623e729/raw/802750cbee7d0303b2dd6f383ab17d48d397f804/flatMap.js'; | |
var t = (0, _yet.task)(function (resolve) { | |
return fetch(url).then(resolve); | |
}); | |
var _runTask = (0, _yet.runTask)(t); | |
var _runTask2 = (0, _slicedToArray3.default)(_runTask, 2); | |
var kill = _runTask2[0]; | |
var futureValue = _runTask2[1]; | |
futureValue.map(function (resp) { | |
return resp.text; | |
}).map(console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment