dethunking-compose
Advanced tools
Comparing version 0.1.0 to 0.1.2
{ | ||
"name": "dethunking-compose", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "Lazy evaluation + compose", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,3 @@ # Dethunking Compose | ||
allows the writing of declarative functional code. | ||
I like to pair this style of coding with large functions at the top of a file | ||
I like to pair this style of coding with the main functions at the top of a file | ||
followed by the definitions of the smaller functions out of which it's composed. | ||
@@ -34,10 +34,10 @@ | ||
var triple_add_3 = module.exports = compose( | ||
() => add_2 | ||
, () => add_1 | ||
, () => triple | ||
() => add_2, | ||
() => add_1, | ||
() => triple | ||
) | ||
var add_2 = compose( | ||
() => add_1, | ||
() => add_1 | ||
, () => add_1 | ||
) | ||
@@ -50,2 +50,20 @@ | ||
Compare to this attempt with a normal compose module, | ||
which would throw. | ||
```js | ||
var compose = require(/* Normal compose module */) | ||
var add_2 = compose( | ||
add_1, | ||
add_1 | ||
) | ||
var add_1 = x => x + 1 | ||
add_2(4) | ||
// undefined is not a function | ||
``` | ||
## Pipe | ||
@@ -59,5 +77,5 @@ | ||
var triple_add_3 = module.exports = pipe( | ||
() => triple | ||
, () => add_1 | ||
, () => add_2 | ||
() => triple, | ||
() => add_1, | ||
() => add_2 | ||
) | ||
@@ -64,0 +82,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9215
82
0