Last active
December 8, 2021 15:46
-
-
Save NetanelBasal/0274fc3c045de1142d1276d377177565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fromEvent } from 'rxjs'; | |
import { map, startWith } from 'rxjs/operators'; | |
function fromMediaQuery(breakpoint: string) { | |
const media = matchMedia(breakpoint); | |
return fromEvent(media, 'change').pipe( | |
map((e: MediaQueryListEvent) => e.matches), | |
startWith(media.matches) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to integrate this concept in my project, finding little difficulty as this article has just pieces. Getting this error, please help