Skip to content

Commit

Permalink
fix(rstream): fix #80 update StreamSource alias
Browse files Browse the repository at this point in the history
- stream source fns don't need to return StreamCancel
  • Loading branch information
postspectacular committed Apr 2, 2019
1 parent feac18d commit f7b9fbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/rstream/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ export interface IStream<T> extends ISubscriber<T> {
}

export type StreamCancel = () => void;
export type StreamSource<T> = (sub: Stream<T>) => StreamCancel;
export type StreamSource<T> = (sub: Stream<T>) => StreamCancel | void;

export let DEBUG = false;
8 changes: 7 additions & 1 deletion packages/rstream/src/stream.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { isString } from "@thi.ng/checks";
import { illegalArity } from "@thi.ng/errors";
import { Transducer } from "@thi.ng/transducers";
import { DEBUG, IStream, ISubscriber, StreamCancel, StreamSource } from "./api";
import {
DEBUG,
IStream,
ISubscriber,
StreamCancel,
StreamSource
} from "./api";
import { Subscription } from "./subscription";
import { nextID } from "./utils/idgen";

Expand Down

0 comments on commit f7b9fbd

Please sign in to comment.