Skip to content

Commit

Permalink
Import all add/* operators, fix scanProto typings (#262)
Browse files Browse the repository at this point in the history
* fix(exports): export all iterable and asynciterable operators

* fix(asynciterable#scanProto): allow AsyncIterable#scan selector to return R | Promise<R>
  • Loading branch information
trxcllnt authored Jan 14, 2019
1 parent d1fa7f7 commit 1f8870f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
54 changes: 34 additions & 20 deletions src/Ix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ import './add/iterable/create';
import './add/iterable/defer';
import './add/iterable/empty';
import './add/iterable/for';
import './add/iterable/generate';
import './add/iterable/if';
import './add/iterable/ofentries';
import './add/iterable/ofkeys';
import './add/iterable/ofvalues';
import './add/iterable/onerrorresumenext';
import './add/iterable/range';
import './add/iterable/repeat';
import './add/iterable/throw';
Expand All @@ -45,8 +51,8 @@ import './add/iterable-operators/buffer';
import './add/iterable-operators/catch';
import './add/iterable-operators/catchwith';
import './add/iterable-operators/chain';
import './add/iterable-operators/concat';
import './add/iterable-operators/concatall';
import './add/iterable-operators/concat';
import './add/iterable-operators/count';
import './add/iterable-operators/defaultifempty';
import './add/iterable-operators/distinct';
Expand All @@ -59,8 +65,8 @@ import './add/iterable-operators/except';
import './add/iterable-operators/expand';
import './add/iterable-operators/filter';
import './add/iterable-operators/finally';
import './add/iterable-operators/find';
import './add/iterable-operators/findindex';
import './add/iterable-operators/find';
import './add/iterable-operators/first';
import './add/iterable-operators/flatmap';
import './add/iterable-operators/flatten';
Expand All @@ -73,36 +79,36 @@ import './add/iterable-operators/intersect';
import './add/iterable-operators/isempty';
import './add/iterable-operators/last';
import './add/iterable-operators/map';
import './add/iterable-operators/max';
import './add/iterable-operators/maxby';
import './add/iterable-operators/max';
import './add/iterable-operators/memoize';
import './add/iterable-operators/min';
import './add/iterable-operators/minby';
import './add/iterable-operators/min';
import './add/iterable-operators/onerrorresumenext';
import './add/iterable-operators/orderby';
import './add/iterable-operators/pairwise';
import './add/iterable-operators/partition';
import './add/iterable-operators/pluck';
import './add/iterable-operators/publish';
import './add/iterable-operators/reduce';
import './add/iterable-operators/reduceright';
import './add/iterable-operators/reduce';
import './add/iterable-operators/repeat';
import './add/iterable-operators/retry';
import './add/iterable-operators/reverse';
import './add/iterable-operators/scan';
import './add/iterable-operators/scanright';
import './add/iterable-operators/scan';
import './add/iterable-operators/sequenceequal';
import './add/iterable-operators/share';
import './add/iterable-operators/single';
import './add/iterable-operators/skip';
import './add/iterable-operators/skiplast';
import './add/iterable-operators/skip';
import './add/iterable-operators/skipwhile';
import './add/iterable-operators/slice';
import './add/iterable-operators/some';
import './add/iterable-operators/startwith';
import './add/iterable-operators/sum';
import './add/iterable-operators/take';
import './add/iterable-operators/takelast';
import './add/iterable-operators/take';
import './add/iterable-operators/takewhile';
import './add/iterable-operators/tap';
import './add/iterable-operators/toarray';
Expand All @@ -112,23 +118,31 @@ import './add/iterable-operators/union';
import './add/iterable-operators/zip';

// async iterable statics
import './add/asynciterable/asyncify';
import './add/asynciterable/asyncifyerrback';
import './add/asynciterable/asyncify';
import './add/asynciterable/case';
import './add/asynciterable/catch';
import './add/asynciterable/combinelatest';
import './add/asynciterable/concat';
import './add/asynciterable/create';
import './add/asynciterable/defer';
import './add/asynciterable/empty';
import './add/asynciterable/for';
import './add/asynciterable/forkjoin';
import './add/asynciterable/fromevent';
import './add/asynciterable/for';
import './add/asynciterable/fromeventpattern';
import './add/asynciterable/fromevent';
import './add/asynciterable/generatetime';
import './add/asynciterable/generate';
import './add/asynciterable/if';
import './add/asynciterable/merge';
import './add/asynciterable/ofentries';
import './add/asynciterable/ofkeys';
import './add/asynciterable/onerrorresumenext';
import './add/asynciterable/race';
import './add/asynciterable/range';
import './add/asynciterable/repeat';
import './add/asynciterable/throw';
import './add/asynciterable/while';
import './add/asynciterable/zip';

// async iterable operators
Expand All @@ -139,8 +153,8 @@ import './add/asynciterable-operators/catch';
import './add/asynciterable-operators/catchwith';
import './add/asynciterable-operators/chain';
import './add/asynciterable-operators/combinelatest';
import './add/asynciterable-operators/concat';
import './add/asynciterable-operators/concatall';
import './add/asynciterable-operators/concat';
import './add/asynciterable-operators/count';
import './add/asynciterable-operators/debounce';
import './add/asynciterable-operators/defaultifempty';
Expand All @@ -154,8 +168,8 @@ import './add/asynciterable-operators/except';
import './add/asynciterable-operators/expand';
import './add/asynciterable-operators/filter';
import './add/asynciterable-operators/finally';
import './add/asynciterable-operators/find';
import './add/asynciterable-operators/findindex';
import './add/asynciterable-operators/find';
import './add/asynciterable-operators/first';
import './add/asynciterable-operators/flatmap';
import './add/asynciterable-operators/flatten';
Expand All @@ -169,39 +183,39 @@ import './add/asynciterable-operators/intersect';
import './add/asynciterable-operators/isempty';
import './add/asynciterable-operators/last';
import './add/asynciterable-operators/map';
import './add/asynciterable-operators/max';
import './add/asynciterable-operators/maxby';
import './add/asynciterable-operators/max';
import './add/asynciterable-operators/memoize';
import './add/asynciterable-operators/merge';
import './add/asynciterable-operators/mergeall';
import './add/asynciterable-operators/min';
import './add/asynciterable-operators/merge';
import './add/asynciterable-operators/minby';
import './add/asynciterable-operators/min';
import './add/asynciterable-operators/onerrorresumenext';
import './add/asynciterable-operators/orderby';
import './add/asynciterable-operators/pairwise';
import './add/asynciterable-operators/partition';
import './add/asynciterable-operators/pluck';
import './add/asynciterable-operators/publish';
import './add/asynciterable-operators/reduce';
import './add/asynciterable-operators/reduceright';
import './add/asynciterable-operators/reduce';
import './add/asynciterable-operators/repeat';
import './add/asynciterable-operators/retry';
import './add/asynciterable-operators/reverse';
import './add/asynciterable-operators/scan';
import './add/asynciterable-operators/scanright';
import './add/asynciterable-operators/scan';
import './add/asynciterable-operators/sequenceequal';
import './add/asynciterable-operators/share';
import './add/asynciterable-operators/single';
import './add/asynciterable-operators/skip';
import './add/asynciterable-operators/skiplast';
import './add/asynciterable-operators/skip';
import './add/asynciterable-operators/skipuntil';
import './add/asynciterable-operators/skipwhile';
import './add/asynciterable-operators/slice';
import './add/asynciterable-operators/some';
import './add/asynciterable-operators/startwith';
import './add/asynciterable-operators/sum';
import './add/asynciterable-operators/take';
import './add/asynciterable-operators/takelast';
import './add/asynciterable-operators/take';
import './add/asynciterable-operators/takeuntil';
import './add/asynciterable-operators/takewhile';
import './add/asynciterable-operators/tap';
Expand Down
6 changes: 3 additions & 3 deletions src/add/asynciterable-operators/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { scan } from '../../asynciterable/scan';

export function scanProto<T, R = T>(
this: AsyncIterableX<T>,
accumulator: (previousValue: R, currentValue: T, currentIndex: number) => R,
accumulator: (previousValue: R, currentValue: T, currentIndex: number) => R | Promise<R>,
seed?: never[]
): AsyncIterableX<R>;
export function scanProto<T, R = T>(
this: AsyncIterableX<T>,
accumulator: (previousValue: R, currentValue: T, currentIndex: number) => R,
accumulator: (previousValue: R, currentValue: T, currentIndex: number) => R | Promise<R>,
seed?: R
): AsyncIterableX<R>;
/**
* @ignore
*/
export function scanProto<T, R = T>(
this: AsyncIterableX<T>,
accumulator: (previousValue: R, currentValue: T, currentIndex: number) => R,
accumulator: (previousValue: R, currentValue: T, currentIndex: number) => R | Promise<R>,
...seed: R[]
): AsyncIterableX<R> {
return scan(this, accumulator, ...seed);
Expand Down

0 comments on commit 1f8870f

Please sign in to comment.