Skip to content

Commit

Permalink
feat(rstream): add trigger() utility stream
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 19, 2018
1 parent e82e312 commit 929c6f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rstream/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from "./stream";
export * from "./stream-merge";
export * from "./stream-sync";
export * from "./subscription";
export * from "./trigger";

export * from "./from/atom";
export * from "./from/event";
Expand Down
10 changes: 10 additions & 0 deletions packages/rstream/src/trigger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { fromIterable } from "./from/iterable";
import { Stream } from "./stream";

/**
* Utility stream. Returns a new stream which emits a single `true`
* value and then closes.
*/
export function trigger(): Stream<boolean> {
return fromIterable([true]);
}

0 comments on commit 929c6f4

Please sign in to comment.