Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate wiki to reflect change for MediaObserver made in beta 24 #1040
Comments
|
@CaerusKaru I saw in another issue that you are rebuilding the docs. In the meanwhile, can you post here how to solve this issue that I'm facing? |
|
While media$ is an Observable<MediaChange>, asObservable returns Observable<MediaChange[]>. In the source, media$ is mapped to the first item in the MediaChange array, so you could optionally, do the exact same thing:
becomes:
Obviously there are many ways to handle it, the big change is you now get an array of changes |
|
@jwhollingsworth Forgive me, but why would mediaObserver publish events where the value would be an empty array? Do we really need to filter for that condition? |
|
@chriszrc If I remember correctly, that was just how the source code at the time mapped between the two. It had the filter, and I just copy and pasted it. No clue what use case that handles other than being extra careful. |
|
I believe that Wiki is now updated.
will throw an error like you'll need to use
|
|
@tonysamperi The documentation is still not updated (https://github.com/angular/flex-layout/wiki/API-Documentation) and shows how to use the deprecated |


Bug Report
What is the expected behavior?
To wiki show the correct way to be used now.
What is the current behavior?
I updated to latest beta 24, and saw that $media got deprecated, but docs still shows the old way for listening for MediaChange (using it).
I couldn't find a way to get the asObservable from MediaObserver that is not from $media like it shows in changelog.
What is the proper way to do it? The wiki needs to be updated to reflect this change