made with esnextbin
Created
August 8, 2016 15:28
-
-
Save theadam/e14977a63548545231a83d17d60c0fe8 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> | |
<div id="app"></div> | |
</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 { curry } from 'ramda'; | |
const test = curry(async function(a, b, c) { | |
return a + b + c; | |
}); | |
const log = x => console.log(x); | |
test(1, 2, 3).then(log); | |
test(1)(2, 3).then(log); | |
test(1)(2)(3).then(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": { | |
"ramda": "0.21.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 _regenerator = require('babel-runtime/regenerator'); | |
var _regenerator2 = _interopRequireDefault(_regenerator); | |
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); | |
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); | |
var _ramda = require('ramda'); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var test = (0, _ramda.curry)(function () { | |
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(a, b, c) { | |
return _regenerator2.default.wrap(function _callee$(_context) { | |
while (1) { | |
switch (_context.prev = _context.next) { | |
case 0: | |
return _context.abrupt('return', a + b + c); | |
case 1: | |
case 'end': | |
return _context.stop(); | |
} | |
} | |
}, _callee, this); | |
})); | |
return function (_x, _x2, _x3) { | |
return ref.apply(this, arguments); | |
}; | |
}()); | |
var log = function log(x) { | |
return console.log(x); | |
}; | |
test(1, 2, 3).then(log); | |
test(1)(2, 3).then(log); | |
test(1)(2)(3).then(log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment