Travis build: 1705
This commit is contained in:
@ -7,11 +7,11 @@ Given a key and a set of arguments, call them when given a context. Primarily us
|
||||
|
||||
Use a closure to call a stored key with stored arguments.
|
||||
|
||||
```js
|
||||
```js
|
||||
const call = (key, ...args) => context => context[key](...args);
|
||||
```
|
||||
|
||||
```js
|
||||
```js
|
||||
Promise.resolve([1, 2, 3])
|
||||
.then(call('map', x => 2 * x))
|
||||
.then(console.log); // [ 2, 4, 6 ]
|
||||
|
||||
Reference in New Issue
Block a user