Skip to content

Instantly share code, notes, and snippets.

@theadam
Created August 8, 2016 15:28
Show Gist options
  • Save theadam/e14977a63548545231a83d17d60c0fe8 to your computer and use it in GitHub Desktop.
Save theadam/e14977a63548545231a83d17d60c0fe8 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>
<div id="app"></div>
</body>
</html>
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);
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"ramda": "0.21.0",
"babel-runtime": "6.11.6"
}
}
'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