Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Commit

Permalink
revert: feat(onionify): support Cycle Unified
Browse files Browse the repository at this point in the history
Remove generic type params until TypeScript 2.3 is out
  • Loading branch information
goodmind authored and staltz committed Apr 11, 2017
1 parent d9ad289 commit e8e6c5d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ export type Lens<T, R> = {
}
export type Scope<T, R> = string | number | Lens<T, R>;

export function pick<T>(selector: Selector | string) {
export function pick(selector: Selector | string) {
if (typeof selector === 'string') {
return function pickWithString(sinksArray$: any): T {
return function pickWithString(sinksArray$: any): Stream<Array<any>> {
return adapt((xs.fromObservable(sinksArray$) as Stream<Array<any>>)
.map(sinksArray => sinksArray.map(sinks => sinks[selector])));
};
} else {
return function pickWithFunction(sinksArray$: any): T {
return function pickWithFunction(sinksArray$: any): Stream<Array<any>> {
return adapt((xs.fromObservable(sinksArray$) as Stream<Array<any>>)
.map(sinksArray => sinksArray.map(selector)));
};
}
}

export function mix<T>(aggregator: Aggregator) {
return function mixOperator(streamArray$: any): T {
export function mix(aggregator: Aggregator) {
return function mixOperator(streamArray$: any): Stream<Array<Stream<any>>> {
return adapt((xs.fromObservable(streamArray$) as Stream<Array<Stream<any>>>)
.map(streamArray => aggregator(...streamArray))
.flatten());
Expand Down

0 comments on commit e8e6c5d

Please sign in to comment.