Skip to content

Commit 5748542

Browse files
authored
docs: correct 15.0.0-rc.2 migration guide (#336)
The *AFTER* code snippets in the migration guide are incorrect as they don't convert an `undefined` query parameter to an empty array (`[]`).
1 parent ad102e1 commit 5748542

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class ShirtsComponent {
5050

5151
size$: Observable<readonly string[]> = this.#routerStore.queryParams$.pipe(
5252
map((params) => params['size']),
53+
map((size) => size ?? []),
5354
map((size) => (Array.isArray(size) ? size : [size]))
5455
);
5556
}
@@ -93,7 +94,10 @@ export class ShirtsComponent {
9394

9495
size$: Observable<readonly string[]> = this.#routerStore
9596
.selectQueryParam('size')
96-
.pipe(map((size) => (Array.isArray(size) ? size : [size])));
97+
.pipe(
98+
map((size) => size ?? []),
99+
map((size) => (Array.isArray(size) ? size : [size]))
100+
);
97101
}
98102
```
99103

0 commit comments

Comments
 (0)