-
Notifications
You must be signed in to change notification settings - Fork 771
fix(matchMediaObservable): expose observable for rxjs operators #133
fix(matchMediaObservable): expose observable for rxjs operators #133
Conversation
@andrewseguin - fyi. |
Presubmit looks good but you've got a fit() test in there. Can you get an LGTM or do you want me to review |
@andrewseguin - I am changing the API. Ready tomorrow. |
aab836d
to
8ca159e
Compare
* rename token to 'ObservableMediaService' * rename MatchMediaObservableProvider to ObservableMediaServiceProvider * add method `.asObservable()` to MediaService BREAKING CHANGE: * use opaque token `ObservableMediateService` to inject instance of `MediaService` * use `MediaService::asObservable()` to get instance of observable ```js // RxJS import 'rxjs/add/operator/map'; @component({ ... }) export class MyComponent { constructor( @Inject(ObservableMediaService) media) { media.asObservable() .map( (change:MediaChange) => change.mqAlias == 'md' ) .subscribe((change:MediaChange) => { let state = change ? `'${change.mqAlias}' = (${change.mediaQuery})` : "" console.log( state ); }); } } ``` fixes #125.
8ca159e
to
5cd43d9
Compare
@andrewseguin - ready now for presubmit + merge. Thx |
Change looks good to me, I'll add an LGTM. In the next PRs, it would be nice to have an LGTM ready on the PR before we send it off for presubmit/merge. Feel free to add anyone on the material2 team to review for future PRs |
Needs a small change to fix some breakage. When you import ObservableMediaService, be sure to refer to the |
@andrewseguin - I just fixed those import issues in the demos. Thx for that catch. LGTM now. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ObservableMediaService
ObservableMediaServiceProvider
.asObservable()
to MediaServiceBREAKING CHANGE:
ObservableMediateService
to inject instance ofMediaService
MediaService::asObservable()
to get instance of observablefixes #125.