Travis build: 147
This commit is contained in:
47
README.md
47
README.md
@ -15,6 +15,7 @@
|
||||
|
||||
### Adapter
|
||||
* [`collectInto`](#collectinto)
|
||||
* [`flip`](#flip)
|
||||
* [`promisify`](#promisify)
|
||||
* [`spreadOver`](#spreadover)
|
||||
|
||||
@ -163,9 +164,6 @@
|
||||
* [`UUIDGenerator`](#uuidgenerator)
|
||||
* [`validateNumber`](#validatenumber)
|
||||
|
||||
### _Uncategorized_
|
||||
* [`flip`](#flip)
|
||||
|
||||
## Adapter
|
||||
|
||||
### collectInto
|
||||
@ -187,6 +185,27 @@ Pall(p1, p2, p3).then(console.log)
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
|
||||
### flip
|
||||
|
||||
Flip takes a function as an argument, then makes the first argument the last
|
||||
|
||||
Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.
|
||||
|
||||
```js
|
||||
const flip = fn => (...args) => fn(args.pop(), ...args)
|
||||
/*
|
||||
let a = {name: 'John Smith'}
|
||||
let b = {}
|
||||
const mergeFrom = flip(Object.assign)
|
||||
let mergePerson = mergeFrom.bind(a)
|
||||
mergePerson(b) // == b
|
||||
b = {}
|
||||
Object.assign(b, a) // == b
|
||||
*/
|
||||
```
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
|
||||
### promisify
|
||||
|
||||
Converts an asynchronous function to return a promise.
|
||||
@ -2218,28 +2237,6 @@ const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) ==
|
||||
// validateNumber('10') -> true
|
||||
```
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
## _Uncategorized_
|
||||
|
||||
### flip
|
||||
|
||||
Flip takes a function as an argument, then makes the first argument the last
|
||||
|
||||
Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.
|
||||
|
||||
```js
|
||||
const flip = fn => (...args) => fn(args.pop(), ...args)
|
||||
/*
|
||||
let a = {name: 'John Smith'}
|
||||
let b = {}
|
||||
const mergeFrom = flip(Object.assign)
|
||||
let mergePerson = mergeFrom.bind(a)
|
||||
mergePerson(b) // == b
|
||||
b = {}
|
||||
Object.assign(b, a) // == b
|
||||
*/
|
||||
```
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
|
||||
## Credits
|
||||
|
||||
Reference in New Issue
Block a user