Skip to content

Commit b721370

Browse files
committed
🥭 w/ references
1 parent dccf719 commit b721370

File tree

3 files changed

+49
-18
lines changed

3 files changed

+49
-18
lines changed

README.md

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ function, [unspread] combines all parameters into the first parameter (array),
2929
[wrap] adds ignored parameters to the left/right of a function's parameters, and
3030
[unwrap] removes common prefix and suffix parameters to a function (by passing
3131
known constant values as prefix/suffix). If you want some **functional**
32-
**behavior**, [compose], [composeRight], [curry], and [curryRight] can be used. If
33-
you are unfamiliar, [Haskell] is a great purely functional language, and there
34-
is great [haskell beginner guide] to learn from.
32+
**behavior**, [compose], [composeRight], [curry], and [curryRight] can be used.
33+
[composeRight] is also known as [pipe-forward operator] or [function chaining].
34+
If you are unfamiliar, [Haskell] is a great purely functional language, and
35+
there is great [haskell beginner guide] to learn from.
3536

3637
To control invocation **time** of a function, use [delay]. A function can be
3738
**rate controlled** with [limitUse], [debounce], [debounceEarly], [throttle],
@@ -47,16 +48,18 @@ refreshing a webpage]. Except [limitUse], all *rate/time control* methods can be
4748
*flushed* (`flush()`) to invoke the target function immediately, or *cleared*
4849
(`clear()`) to disable invocation of the target function.
4950

50-
In addition, use [is], [isAsync], [isGenerator], [signature], [name],
51-
[parameters], and [arity] to obtain metadata (about) information on a function.
52-
A few generic functions are also included: [ARGUMENTS], [NOOP], [IDENTITY],
53-
[COMPARE].
51+
In addition, [is], [isAsync], [isGenerator], [signature], [name], [parameters],
52+
and [arity] obtain metadata (about) information on a function. To attach a
53+
`this` to a function, use [bind]. A few generic functions are also included:
54+
[ARGUMENTS], [NOOP], [IDENTITY], [COMPARE].
5455

5556
This package is available in both *Node.js* and *Web* formats. The web format is
5657
exposed as `extra_function` standalone variable and can be loaded from [jsDelivr CDN].
5758

5859
[(1)]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
5960
[lambda calculus]: https://en.wikipedia.org/wiki/Lambda_calculus
61+
[pipe-forward operator]: https://stackoverflow.com/questions/1457140/haskell-composition-vs-fs-pipe-forward-operator
62+
[function chaining]: https://www.npmjs.com/package/chain-function
6063
[Haskell]: https://www.haskell.org
6164
[haskell beginner guide]: http://learnyouahaskell.com
6265
[constantly refreshing a webpage]: https://tenor.com/view/social-network-mark-zuckerberg-refresh-movie-jesse-eisenberg-gif-12095762
@@ -72,17 +75,17 @@ const funcxion = require('extra-function');
7275
// import * as funcxion from "extra-function";
7376
// import * as funcxion from "https://unpkg.com/extra-function/index.mjs"; (deno)
7477

75-
funcxion.sum(1, 2, 3, 4);
76-
//10
78+
funcxion.composeRight(x => x*x, x => x+2);
79+
//102
7780

78-
funcxion.median(1, 7, 8);
81+
funcxion.curry((x, y) => x+y);
7982
// → 7
8083

81-
funcxion.variance(1, 2, 3, 4);
84+
funcxion.unspread(Math.max);
8285
// → 1.25
8386

84-
funcxion.lcm(2, 3, 4);
85-
//12
87+
funcxion.parameters((x, y) => x+y);
88+
//[ 'x', 'y' ]
8689
```
8790

8891
<br>
@@ -99,6 +102,7 @@ funcxion.lcm(2, 3, 4);
99102
| [COMPARE] | Compare two values. |
100103
| | |
101104
| [is] | Check if value is a function. |
105+
| [isAsync] | Check if value is an async function. |
102106
| [isGenerator] | Check if value is a generator function. |
103107
| [signature] | Get the signature of a function. |
104108
| [name] | Get the name of a function. |
@@ -136,20 +140,47 @@ funcxion.lcm(2, 3, 4);
136140

137141
## References
138142

139-
- [Modulo operation](https://en.wikipedia.org/wiki/Modulo_operation)
143+
- [MDN Web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference)
144+
- [Lodash documentation](https://lodash.com/docs/4.17.15)
145+
- [Underscore.js documentation](https://underscorejs.org/)
146+
- [Function composition](https://en.wikipedia.org/wiki/Function_composition)
147+
- [Debouncing and Throttling Explained Through Examples by David Corbacho](https://css-tricks.com/debouncing-throttling-explained-examples/)
148+
- [Learn You a Haskell for Great Good!: Higher order functions by Miran Lipovaca](http://learnyouahaskell.com/higher-order-functions)
149+
- [How to know if a function is async?](https://stackoverflow.com/questions/38508420/how-to-know-if-a-function-is-async)
150+
- [Check if function is a generator](https://stackoverflow.com/questions/16754956/check-if-function-is-a-generator)
151+
- [Haskell composition (.) vs F#'s pipe forward operator (|>)](https://stackoverflow.com/questions/1457140/haskell-composition-vs-fs-pipe-forward-operator)
152+
- [JavaScript Detect Async Function by David Walsh](https://davidwalsh.name/javascript-detect-async-function)
153+
- [is-function package by Stephen Sugden](https://www.npmjs.com/package/is-function)
154+
- [is-async-function package by Jordan Harband](https://www.npmjs.com/package/is-async-function)
155+
- [is-callback-function package by Charlike Mike Reagent](https://www.npmjs.com/package/is-callback-function)
156+
- [is-generator-fn package by Sindre Sorhus](https://www.npmjs.com/package/is-generator-fn)
157+
- [is-generator-function package by Jordan Harband](https://www.npmjs.com/package/is-generator-function)
158+
- [fn-name package by Sindre Sorhus](https://www.npmjs.com/package/fn-name)
159+
- [memoizee package by Mariusz Nowak](https://www.npmjs.com/package/memoizee)
160+
- [memoizerific package by @thinkloop](https://www.npmjs.com/package/memoizerific)
161+
- [compose-function package by Christoph Hermann](https://www.npmjs.com/package/compose-function)
162+
- [chain-function package by Jason Quense](https://www.npmjs.com/package/chain-function)
163+
- [@spudly/curry package by Stephen Sorensen](https://www.npmjs.com/package/@spudly/curry)
164+
- [one-time package by Arnout Kazemier](https://www.npmjs.com/package/one-time)
165+
- [onetime package by Sindre Sorhus](https://www.npmjs.com/package/onetime)
166+
- [once package by Isaac Z. Schlueter](https://www.npmjs.com/package/once)
167+
- [debounce package by @component](https://www.npmjs.com/package/debounce)
168+
- [throttle-debounce package by Ivan Nikolić](https://www.npmjs.com/package/throttle-debounce)
169+
- [throttleit package by @component](https://www.npmjs.com/package/throttleit)
140170

141171
<br>
142172
<br>
143173

144174

145-
[![](https://img.youtube.com/vi/dW8Cy6WrO94/maxresdefault.jpg)](https://www.youtube.com/watch?v=dW8Cy6WrO94)<br>
175+
[![](https://img.youtube.com/vi/vzfy4EKwG_Y/maxresdefault.jpg)](https://www.youtube.com/watch?v=vzfy4EKwG_Y)<br>
146176

147177

148178
[ARGUMENTS]: https://nodef.github.io/extra-function/modules.html#ARGUMENTS
149179
[NOOP]: https://nodef.github.io/extra-function/modules.html#NOOP
150180
[IDENTITY]: https://nodef.github.io/extra-function/modules.html#IDENTITY
151181
[COMPARE]: https://nodef.github.io/extra-function/modules.html#COMPARE
152182
[is]: https://nodef.github.io/extra-function/modules.html#is
183+
[isAsync]: https://nodef.github.io/extra-function/modules.html#isAsync
153184
[isGenerator]: https://nodef.github.io/extra-function/modules.html#isGenerator
154185
[signature]: https://nodef.github.io/extra-function/modules.html#signature
155186
[name]: https://nodef.github.io/extra-function/modules.html#name

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extra-function",
3-
"version": "0.1.5",
3+
"version": "1.0.0",
44
"description": "A collection of ways for transforming functions.",
55
"main": "index.js",
66
"module": "index.mjs",

0 commit comments

Comments
 (0)