Created
May 3, 2021 08:47
-
-
Save armanozak/a30bcf7a19593d9625de73b29638bed4 to your computer and use it in GitHub Desktop.
[What's New in RxJS 7] Better types with filter(Boolean) #blog #rxjs
This file contains hidden or 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 { of } from "rxjs"; | |
import { filter } from "rxjs/operators"; | |
// Observable<"" | 0 | null | undefined | Date> | |
of("" as const, 0 as const, null, undefined, new Date()) | |
.pipe(filter(Boolean)) | |
.subscribe(); | |
// Observable<Date> (in RxJS 6 → Observable<unknown>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment