Skip to content

Commit

Permalink
Merge pull request #369 from joelnet/develop
Browse files Browse the repository at this point in the history
Deploy to Master
  • Loading branch information
joelnet committed Jan 22, 2021
2 parents 3682670 + 5fb8713 commit a45d198
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 40 deletions.
4 changes: 2 additions & 2 deletions core/pipeR.mdx
Expand Up @@ -12,13 +12,13 @@ Pipe is an asynchronous function composer for recursive functions.
## Example

```javascript
import { log, pipeR, run, wait } from 'mojiscript'
import { log, pipeR, run, sleep } from 'mojiscript'

const state = 1

const main = pipeR (next => [
log,
wait (1000),
sleep (1000),
x => next (x + 1)
])

Expand Down
23 changes: 7 additions & 16 deletions examples/star-wars-console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/star-wars-console/package.json
Expand Up @@ -9,7 +9,7 @@
"start": "node --experimental-modules --no-warnings index.mjs"
},
"dependencies": {
"axios": "^0.19.0",
"axios": "^0.21.1",
"mojiscript": "file:../..",
"mojiscript-cli": "0.0.3",
"ramda": "^0.26.1"
Expand Down
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -23,6 +23,7 @@ module.exports.join = require('./list/join')
module.exports.map = require('./list/map')
module.exports.range = require('./list/range')
module.exports.reduce = require('./list/reduce')
module.exports.reduceWhile = require('./list/reduceWhile')
module.exports.sort = require('./list/sort')
module.exports.tail = require('./list/tail')
module.exports.allPass = require('./logic/allPass')
Expand Down
5 changes: 1 addition & 4 deletions list/ap.mdx
Expand Up @@ -14,11 +14,8 @@ ap applies a list of functions to a list of values.
```javascript
import { ap } from 'mojiscript'

const double = num => num * 2
const array = [ 1, 2, 3 ]

ap ([Math.sqrt, x => x * x]) ([1, 4, 9, 16, 25])
//=> ​​​​​[ 1, 2, 3, 4, 5, 1, 16, 81, 256, 625 ]​​​​​
//=> [ 1, 2, 3, 4, 5, 1, 16, 81, 256, 625 ]
```

## Functor Example
Expand Down
5 changes: 2 additions & 3 deletions list/flatMap.mdx
Expand Up @@ -25,10 +25,9 @@ flatMap (andTimesTen) (array) //=> [ 1, 10, 2, 20, 3, 30 ]
## Iterator Example

```javascript
import { map, range } from 'mojiscript'
import { flatMap } from 'mojiscript'

const andTimesTen = num => [ num, num * 10 ]
const array = [ 1, 2, 3 ]

flatMap (andTimesTen) (range (1) (4)) //=> [ 1, 10, 2, 20, 3, 30 ]
```
Expand All @@ -45,7 +44,7 @@ const asyncAndTimesTen = pipe ([
])
const array = [ 1, 2, 3 ]

flatMap (asyncAndTimesTen) (array) //=> Promise ([ 1, 10, 2, 20, 3, 30 ]​​​​​)
flatMap (asyncAndTimesTen) (array) //=> Promise ([ 1, 10, 2, 20, 3, 30 ])
```

## Parameters
Expand Down
4 changes: 2 additions & 2 deletions list/map.mdx
Expand Up @@ -29,9 +29,9 @@ import { map, range } from 'mojiscript'

const double = num => num * 2

const iterator = makeIterator()
const iterator = range (1) (4)

map (double) (range (1) (4)) //=> [ 2, 4, 6 ]
map (double) (iterator) //=> [ 2, 4, 6 ]
```

## Async Example
Expand Down
2 changes: 1 addition & 1 deletion list/reduce.mdx
Expand Up @@ -45,5 +45,5 @@ const asyncAdd = x => pipe ([

const array = [ 1, 2, 3 ]

reduce (asyncAdd) (0) (array) //=> Promise ([ 2, 4, 6 ])
reduce (asyncAdd) (0) (array) //=> Promise (6)
```
45 changes: 35 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@types/jest": "^26.0.4",
"all-contributors-cli": "^6.16.1",
"axios": "^0.19.2",
"axios": "^0.21.1",
"coveralls": "^3.1.0",
"docz": "^2.3.1",
"docz-theme-default": "^1.2.0",
Expand Down

0 comments on commit a45d198

Please sign in to comment.