Skip to content

Commit

Permalink
Document changes to fromNode that allow the return fn to be partially…
Browse files Browse the repository at this point in the history
… applied in some cases
  • Loading branch information
JamieDixon committed May 29, 2020
1 parent de54156 commit 030c299
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions docs/src/pages/docs/crocks/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,17 @@ As such, the need for binding may arise. `fromNode` provides a second, optional
argument that takes the context that will be used to bind the function being
wrapped.

Any curried interface will not be respected and if a curried interface is needed
then [`nAry`][nary] can be used.
The function returned from `fromNode` will be automatically curried, allowing you
to partially apply the function up to its penultimate parameter<sup>[1]</sup>, so long as the
arity of the original function given to `fromNode` can be determined via its `.length` property.

In practice this means that functions defined via `compose` or those making use
of `arguments`, spread args (`...args`) or default values for parameters, will not be
good candidates for partial application.

<sup>[1]</sup> The final parameter to the incoming function is provided to you by`fromNode` rather
than being part of the parameters that can be partially applied.


<!-- eslint-disable no-console -->
<!-- eslint-disable no-sequences -->
Expand Down

0 comments on commit 030c299

Please sign in to comment.