-
-
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.
## Features - Remove optional type parameter from `RouterStore#selectRouteData` - Replace `MinimalRouteData` with `StrictRouteData` - Change `RouterStore#routeData$` type from `Data` to `StrictRouteData` **BREAKING CHANGES** The type parameter is removed from `RouterStore#selectRouteData` for stricter typing and to enforce coercion. BEFORE: *(Router Component Store <=0.3.2)* ```typescript // heroes.component.ts // (...) import { RouterStore } from '@ngworker/router-component-store'; @component({ // (...) }) export class HeroesComponent { #routerStore = inject(RouterStore); limit$ = this.#routerStore.selectRouteData<number>('limit'); } ``` AFTER: *(Router Component Store >0.3.2)* ```typescript // heroes.component.ts // (...) import { RouterStore } from '@ngworker/router-component-store'; @component({ // (...) }) export class HeroesComponent { #routerStore = inject(RouterStore); limit$ = this.#routerStore.selectRouteData('limit').pipe(x => Number(x)); ``` The `RouterStore#routeData$` selector emits `StrictRouteData` instead of `Data`. BEFORE: _(Router Component Store <=0.3.2)_ ```typescript // heroes.component.ts // (...) import { RouterStore } from "@ngworker/router-component-store"; @component({ // (...) }) export class HeroesComponent { #routerStore = inject(RouterStore); limit$: Observable<number> = this.#routerStore.routeData$.pipe( map((routeData) => routeData["limit"]) ); } ``` AFTER: _(Router Component Store >0.3.2)_ ```typescript // heroes.component.ts // (...) import { RouterStore } from '@ngworker/router-component-store'; @component({ // (...) }) export class HeroesComponent { #routerStore = inject(RouterStore); limit$: Observable<number> = this.#routerStore.routeData$.pipe( map(routeData => routeData['limit']), map(x => Number(x)) ); ```
- Loading branch information
Showing
16 changed files
with
74 additions
and
52 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
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
Oops, something went wrong.