Skip to content

Commit

Permalink
Drop ArrayChain
Browse files Browse the repository at this point in the history
Refs: #420
  • Loading branch information
o-rumiantsev committed Jun 12, 2019
1 parent 42ebb93 commit c843231
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 337 deletions.
3 changes: 1 addition & 2 deletions .metadocrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"lib/adapters.js",
"lib/array.js",
"lib/async-iterator.js",
"lib/chain.js",
"lib/collector.js",
"lib/composition.js",
"lib/control.js",
Expand All @@ -19,9 +18,9 @@
"lib/throttle.js"
],
"customLinks": {
"Iterable": "https://tc39.es/ecma262/#sec-iterator-interface",
"AsyncIterable": "https://tc39.github.io/ecma262/#sec-asynciterable-interface",
"AsyncIterator": "#class-asynciterator",
"ArrayChain": "#class-arraychain",
"Collector": "#class-collector",
"Composition": "#class-composition",
"Memoized": "#class-memoized",
Expand Down
94 changes: 26 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,31 @@ Convert sync function to Promise object

### map(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function] to be executed for each value in the array
- `current`: `<any>` current element being processed in the array
- `callback`: [`<Function>`][function]
- `err`: [`<Error>`][error]|[`<null>`][null]
- `value`: `<any>`
- `done`: [`<Function>`][function] on done
- `err`: [`<Error>`][error]|[`<null>`][null]
- `result`: [`<Array>`][array]
- `result`: [`<Iterable>`][iterable]

Asynchronous map (iterate parallel)

### filter(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function] to be executed for each value in the array
- `value`: `<any>` item from items array
- `callback`: [`<Function>`][function]
- `err`: [`<Error>`][error]|[`<null>`][null]
- `accepted`: [`<boolean>`][boolean]
- `done`: [`<Function>`][function] on done
- `err`: [`<Error>`][error]|[`<null>`][null]
- `result`: [`<Array>`][array]
- `result`: [`<Iterable>`][iterable]

Asynchrous filter (iterate parallel)
Asynchronous filter (iterate parallel)

_Example:_

Expand All @@ -138,7 +138,7 @@ metasync.filter(

### reduce(items, fn, done\[, initial\])

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function] to be executed for each value in array
- `previous`: `<any>` value previously returned in the last iteration
- `current`: `<any>` current element being processed in the array
Expand All @@ -148,18 +148,18 @@ metasync.filter(
- `data`: `<any>` resulting value
- `counter`: [`<number>`][number] index of the current element being processed
in array
- `items`: [`<Array>`][array] the array reduce was called upon
- `done`: [`<Function>`][function] on done
- `items`: [`<Iterable>`][iterable] the array reduce was called upon
- `done`: [`<Function>`][function] on done, optional
- `err`: [`<Error>`][error]|[`<null>`][null]
- `result`: [`<Array>`][array]
- `result`: [`<Iterable>`][iterable]
- `initial`: `<any>` optional value to be used as first argument in first
iteration

Asynchronous reduce

### reduceRight(items, fn, done\[, initial\])

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function] to be executed for each value in array
- `previous`: `<any>` value previously returned in the last iteration
- `current`: `<any>` current element being processed in the array
Expand All @@ -169,25 +169,25 @@ Asynchronous reduce
- `data`: `<any>` resulting value
- `counter`: [`<number>`][number] index of the current element being processed
in array
- `items`: [`<Array>`][array] the array reduce was called upon
- `done`: [`<Function>`][function] on done
- `items`: [`<Iterable>`][iterable] the array reduce was called upon
- `done`: [`<Function>`][function] on done, optional
- `err`: [`<Error>`][error]|[`<null>`][null]
- `result`: [`<Array>`][array]
- `result`: [`<Iterable>`][iterable]
- `initial`: `<any>` optional value to be used as first argument in first
iteration

Asynchronous reduceRight

### each(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function]
- `value`: `<any>` item from items array
- `callback`: [`<Function>`][function]
- `err`: [`<Error>`][error]|[`<null>`][null]
- `done`: [`<Function>`][function] on done
- `err`: [`<Error>`][error]|[`<null>`][null]
- `items`: [`<Array>`][array]
- `items`: [`<Iterable>`][iterable]

Asynchronous each (iterate in parallel)

Expand All @@ -206,14 +206,14 @@ metasync.each(

### series(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function]
- `value`: `<any>` item from items array
- `callback`: [`<Function>`][function]
- `err`: [`<Error>`][error]|[`<null>`][null]
- `done`: [`<Function>`][function] on done
- `err`: [`<Error>`][error]|[`<null>`][null]
- `items`: [`<Array>`][array]
- `items`: [`<Iterable>`][iterable]

Asynchronous series

Expand All @@ -234,7 +234,7 @@ metasync.series(

### find(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function]
- `value`: `<any>` item from items array
- `callback`: [`<Function>`][function]
Expand All @@ -260,7 +260,7 @@ metasync.find(

### every(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function]
- `value`: `<any>` item from items array
- `callback`: [`<Function>`][function]
Expand All @@ -274,7 +274,7 @@ Asynchronous every

### some(items, fn, done)

- `items`: [`<Array>`][array] incoming
- `items`: [`<Iterable>`][iterable] incoming
- `fn`: [`<Function>`][function]
- `value`: `<any>` item from items array
- `callback`: [`<Function>`][function]
Expand All @@ -288,7 +288,7 @@ Asynchronous some (iterate in series)

### asyncMap(items, fn\[, options\]\[, done\])

- `items`: [`<Array>`][array] incoming dataset
- `items`: [`<Iterable>`][iterable] incoming dataset
- `fn`: [`<Function>`][function]
- `item`: `<any>`
- `index`: [`<number>`][number]
Expand All @@ -297,7 +297,7 @@ Asynchronous some (iterate in series)
- `percent`: [`<number>`][number] ratio of map time to all time
- `done`: [`<Function>`][function] call on done, optional
- `err`: [`<Error>`][error]|[`<null>`][null]
- `result`: [`<Array>`][array]
- `result`: [`<Iterable>`][iterable]

Non-blocking synchronous map

Expand Down Expand Up @@ -332,6 +332,8 @@ Create an AsyncIterator instance

#### async AsyncIterator.prototype.reduce(reducer, initialValue)

#### async AsyncIterator.prototype.reduceRight(reducer, initialValue)

#### async AsyncIterator.prototype.some(predicate, thisArg)

#### async AsyncIterator.prototype.someCount(predicate, count, thisArg)
Expand Down Expand Up @@ -366,51 +368,7 @@ Create an AsyncIterator instance

#### AsyncIterator.prototype.enumerate()

### for(array)

- `array`: [`<Array>`][array] start mutations from this data

_Returns:_ [`<ArrayChain>`][arraychain]

Create ArrayChain instance

### class ArrayChain

#### ArrayChain.prototype.constructor(array)

#### ArrayChain.prototype.execute(err)

#### ArrayChain.prototype.fetch(fn)

#### ArrayChain.prototype.map(fn)

#### ArrayChain.prototype.filter(fn)

#### ArrayChain.prototype.reduce(fn)

#### ArrayChain.prototype.each(fn)

#### ArrayChain.prototype.series(fn)

#### ArrayChain.prototype.find(fn)

#### ArrayChain.prototype.concat(...args)

#### ArrayChain.prototype.slice(...args)

#### ArrayChain.prototype.includes(...args)

#### ArrayChain.prototype.reverse(...args)

#### ArrayChain.prototype.sort(...args)

#### ArrayChain.prototype.shift(...args)

#### ArrayChain.prototype.unshift(...args)

#### ArrayChain.prototype.push(...args)

#### ArrayChain.prototype.pop(...args)
#### AsyncIterator.prototype.reverse()

### collect(expected)

Expand Down Expand Up @@ -913,9 +871,9 @@ Set timeout for asynchronous function execution
- Timur Shemsedinov (marcusaurelius)
- See github for full [contributors list](https://github.com/metarhia/metasync/graphs/contributors)

[iterable]: https://tc39.es/ecma262/#sec-iterator-interface
[asynciterable]: https://tc39.github.io/ecma262/#sec-asynciterable-interface
[asynciterator]: #class-asynciterator
[arraychain]: #class-arraychain
[collector]: #class-collector
[queue]: #class-queue
[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
Expand Down

0 comments on commit c843231

Please sign in to comment.