Travis build: 1393
This commit is contained in:
54
README.md
54
README.md
@ -229,6 +229,8 @@ average(1, 2, 3);
|
||||
* [`memoize`](#memoize)
|
||||
* [`negate`](#negate)
|
||||
* [`once`](#once)
|
||||
* [`partial`](#partial)
|
||||
* [`partialRight`](#partialright)
|
||||
* [`runPromisesInSeries`](#runpromisesinseries)
|
||||
* [`sleep`](#sleep)
|
||||
* [`times`](#times)
|
||||
@ -3502,6 +3504,58 @@ document.body.addEventListener('click', once(startApp)); // only runs `startApp`
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### partial
|
||||
|
||||
Creates a function that invokes `fn` with `partials` prepended to the arguments it receives.
|
||||
|
||||
Use the spread operator (`...`) to prepend `partials` to the list of arguments of `fn`.
|
||||
|
||||
```js
|
||||
const partial = (fn, ...partials) => (...args) => fn(...partials, ...args);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
function greet(greeting, name) {
|
||||
return greeting + ' ' + name + '!';
|
||||
}
|
||||
const greetHello = partial(greet, 'Hello');
|
||||
greetHello('John'); // 'Hello John!'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### partialRight
|
||||
|
||||
Creates a function that invokes `fn` with `partials` appended to the arguments it receives.
|
||||
|
||||
Use the spread operator (`...`) to append `partials` to the list of arguments of `fn`.
|
||||
|
||||
```js
|
||||
const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
function greet(greeting, name) {
|
||||
return greeting + ' ' + name + '!';
|
||||
}
|
||||
const greetJohn = partialRight(greet, 'John');
|
||||
greetJohn('Hello'); // 'Hello John!'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### runPromisesInSeries
|
||||
|
||||
Runs an array of promises in series.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@ Creates a function that invokes `fn` with `partials` appended to the arguments i
|
||||
Use the spread operator (`...`) to append `partials` to the list of arguments of `fn`.
|
||||
|
||||
```js
|
||||
const partialRight = (fn, ...partials) => (...args) => fn( ...args, ...partials);
|
||||
const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials);
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user