Skip to content

Commit

Permalink
feat(ObservableMediaService): export ObservableMedia interface for ty…
Browse files Browse the repository at this point in the history
…pe use
  • Loading branch information
ThomasBurleson committed Feb 5, 2017
1 parent aaeb525 commit 69c3424
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/media-query/observable-media-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import {BreakPoint} from './breakpoints/break-point';
// tslint:disable-next-line:variable-name
export const ObservableMediaService: OpaqueToken = new OpaqueToken('flex-layout-media-service');

export interface ObservableMedia<T> extends Subscribable<T> {
isActive(query: string): boolean;
asObservable(): Observable<T>;
}

/**
* Class internalizes a MatchMedia service and exposes an Subscribable and Observable interface.
Expand Down Expand Up @@ -65,7 +69,7 @@ export const ObservableMediaService: OpaqueToken = new OpaqueToken('flex-layout-
* }
* }
*/
export class MediaService implements Subscribable<MediaChange> {
export class MediaService implements ObservableMedia<MediaChange> {
private observable$: Observable<MediaChange>;

constructor(private mediaWatcher: MatchMedia,
Expand Down

0 comments on commit 69c3424

Please sign in to comment.