Skip to content

Commit

Permalink
Expose IStreamListener, implements #143
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Sep 4, 2018
1 parent 66ad42a commit 3d7e445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 5.0.2

* Improved typings of `toStream`, by [@pelotom](https://github.com/pelotom) through [#147](https://github.com/mobxjs/mobx-utils/pull/147)
* Improved typings of `fromStream`, `IStreamListener` is now an explicit interface. Fixes [#143](https://github.com/mobxjs/mobx-utils/issues/143)

# 5.0.1

* Add `sideEffects: false` field in package.json to enable maximal tree shaking for webpack.
Expand Down
8 changes: 5 additions & 3 deletions src/observable-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ class StreamListener<T> implements IStreamObserver<T> {
export function fromStream<T>(
observable: IObservableStream<T>,
initialValue: T = undefined
): {
): IStreamListener<T> {
return new StreamListener(observable, initialValue)
}

export interface IStreamListener<T> {
current: T
dispose(): void
} {
return new StreamListener(observable, initialValue)
}

0 comments on commit 3d7e445

Please sign in to comment.