Skip to content

Commit

Permalink
feat(observable): move subscription to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpodwysocki committed Jul 25, 2017
1 parent c505389 commit 335f694
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/asynciterable/toobservable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Observable, Observer, Subscription } from '../observer';
import { Observable, Observer } from '../observer';
import { Subscription } from '../subscription';

class BooleanSubscription implements Subscription {
public isUnsubscribed: boolean = false;
Expand Down
6 changes: 2 additions & 4 deletions src/observer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Subscription } from './subscription';

export interface NextObserver<T> {
next: (value: T) => void;
error?: (err: any) => void;
Expand Down Expand Up @@ -44,10 +46,6 @@ export type PartialAsyncObserver<T> =
ErrorAsyncObserver<T> |
CompletionAsyncObserver<T>;

export interface Subscription {
unsubscribe: () => void;
}

export interface Observer<T> {
closed?: boolean;
next: (value: T) => void;
Expand Down
3 changes: 3 additions & 0 deletions src/subscription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface Subscription {
unsubscribe: () => void;
}

0 comments on commit 335f694

Please sign in to comment.