Skip to content

Commit

Permalink
Add ObserverLike type
Browse files Browse the repository at this point in the history
  • Loading branch information
bigslycat committed Oct 19, 2018
1 parent d3eb0fd commit 35b8035
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/es-observable/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export interface ObserverInterface<T> {
+complete?: void | (() => void);
}

export type ObserverLike<T> = {
+next?: (value: T) => void,
+error?: (errorValue: Error) => void,
+complete?: () => void,
};

export interface SubscriptionObserverInterface<T> {
next(value: T): void;
error(errorValue: Error): void;
Expand Down

0 comments on commit 35b8035

Please sign in to comment.