-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: make parameter selector types stricter (#278)
# Feature - Remove type parameter from `selectQueryParam` - Specify strict observable type returned from `selectQueryParam` - Remove type parameter from `selectRouteParam` - Specify strict observable type returned from `selectRouteParam` BREAKING CHANGE: - Stricter types for `selectQueryParam` Before: ```typescript // Actual emitted values are of type `string | undefined` regardless of what we specify const filter$ = routerStore.selectQueryParam<string | null>('filter'); ``` After: ```typescript // Emitted values are implicitly of type `string | undefined` and are only changeable through operators const filter$ = routerStore.selectQueryParam('filter').pipe( map(filter => filter ?? null), ); ``` - Stricter types for `selectRouteParam` Before: ```typescript // Actual emitted values are of type `string | undefined` regardless of what we specify const id$ = routerStore.selectRouteParam<number>('id'); ``` After: ```typescript // Emitted values are implicitly of type `string | undefined` and are only changeable through operators const id$ = routerStore.selectRouteParam('id').pipe( map(id => id === undefined ? undefined : Number(id), ); ```
- Loading branch information
Showing
7 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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