Skip to content

Commit

Permalink
fix(groupBy): fixing missing this in groupBy operator prototype signa…
Browse files Browse the repository at this point in the history
…tures

Fixes #33
  • Loading branch information
Pat Sissons authored and trxcllnt committed Aug 24, 2017
1 parent 91c36a2 commit ff2ee18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/add/asynciterable-operators/groupby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { groupBy, GroupedAsyncIterable } from '../../asynciterable/groupby';
import { identityAsync } from '../../internal/identity';

export function groupByProto<TSource, TKey>(
source: AsyncIterable<TSource>,
this: AsyncIterable<TSource>,
keySelector: (value: TSource) => TKey | Promise<TKey>): AsyncIterableX<GroupedAsyncIterable<TKey, TSource>>;
export function groupByProto<TSource, TKey, TValue>(
source: AsyncIterable<TSource>,
this: AsyncIterable<TSource>,
keySelector: (value: TSource) => TKey | Promise<TKey>,
elementSelector?: (value: TSource) => TValue | Promise<TValue>): AsyncIterableX<GroupedAsyncIterable<TKey, TValue>>;
/**
* @ignore
*/
export function groupByProto<TSource, TKey, TValue>(
source: AsyncIterable<TSource>,
this: AsyncIterable<TSource>,
keySelector: (value: TSource) => TKey | Promise<TKey>,
elementSelector: (value: TSource) => TValue | Promise<TValue> = identityAsync): AsyncIterableX<GroupedAsyncIterable<TKey, TValue>> {
return groupBy<TSource, TKey, TValue>(source, keySelector, elementSelector);
return groupBy<TSource, TKey, TValue>(this, keySelector, elementSelector);
}

AsyncIterableX.prototype.groupBy = groupByProto;
Expand Down
8 changes: 4 additions & 4 deletions src/add/iterable-operators/groupby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { groupBy, GroupedIterable } from '../../iterable/groupby';
import { identity } from '../../internal/identity';

export function groupByProto<TSource, TKey>(
source: Iterable<TSource>,
this: Iterable<TSource>,
keySelector: (value: TSource) => TKey): IterableX<GroupedIterable<TKey, TSource>>;
export function groupByProto<TSource, TKey, TValue>(
source: Iterable<TSource>,
this: Iterable<TSource>,
keySelector: (value: TSource) => TKey,
elementSelector?: (value: TSource) => TValue): IterableX<GroupedIterable<TKey, TValue>>;
/**
* @ignore
*/
export function groupByProto<TSource, TKey, TValue>(
source: Iterable<TSource>,
this: Iterable<TSource>,
keySelector: (value: TSource) => TKey,
elementSelector: (value: TSource) => TValue = identity): IterableX<GroupedIterable<TKey, TValue>> {
return groupBy<TSource, TKey, TValue>(source, keySelector, elementSelector);
return groupBy<TSource, TKey, TValue>(this, keySelector, elementSelector);
}

IterableX.prototype.groupBy = groupByProto;
Expand Down

0 comments on commit ff2ee18

Please sign in to comment.