Skip to content

Commit f561e15

Browse files
authored
chore: release v0.2.0 (#279)
- Bump major prerelease version to reflect breaking changes - Add release notes with migration guides to the changelog
1 parent f314c63 commit f561e15

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

CHANGELOG.md

+83
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,88 @@
11
# Router Component Store changelog
22

3+
## 0.2.0 (2022-10-24)
4+
5+
### Features
6+
7+
- Remove type parameter from `selectQueryParam`
8+
- Specify observable type returned from `selectQueryParam`
9+
- Remove type parameter from `selectRouteParam`
10+
- Specify observable type returned from `selectRouteParam`
11+
12+
### **BREAKING CHANGES**
13+
14+
#### Stricter signature for selectQueryParam
15+
16+
Signature before:
17+
18+
```typescript
19+
selectQueryParam<TValue>(param: string): Observable<TValue>;
20+
```
21+
22+
Signature after:
23+
24+
```typescript
25+
selectQueryParam(param: string): Observable<string | undefined>;
26+
```
27+
28+
##### Migration
29+
30+
Loose types now yield compilation errors. Remove the type parameter to use the
31+
actual emitted type of `string | undefined` and optionally use operators to
32+
change or narrow the type.
33+
34+
Before:
35+
36+
```typescript
37+
// Actual emitted values are of type `string | undefined` regardless of what we specify
38+
const filter$ = routerStore.selectQueryParam<string | null>('filter');
39+
```
40+
41+
After:
42+
43+
```typescript
44+
// Emitted values are implicitly of type `string | undefined` and are only changeable through operators
45+
const filter$ = routerStore
46+
.selectQueryParam('filter')
47+
.pipe(map((filter) => filter ?? null));
48+
```
49+
50+
#### Stricter signature for selectRouteParam
51+
52+
Signature before:
53+
54+
```typescript
55+
selectRouteParam<TValue>(param: string): Observable<TValue>;
56+
```
57+
58+
Signature after:
59+
60+
```typescript
61+
selectRouteParam(param: string): Observable<string | undefined>;
62+
```
63+
64+
##### Migration
65+
66+
Loose types now yield compilation errors. Remove the type parameter to use the
67+
actual emitted type of `string | undefined` and optionally use operators to
68+
change or narrow the type.
69+
70+
Before:
71+
72+
```typescript
73+
// Actual emitted values are of type `string | undefined` regardless of what we specify
74+
const id$ = routerStore.selectRouteParam<number>('id');
75+
```
76+
77+
After:
78+
79+
```typescript
80+
// Emitted values are implicitly of type `string | undefined` and are only changeable through operators
81+
const id$ = routerStore.selectRouteParam('id').pipe(
82+
map(id => id === undefined ? undefined : Number(id),
83+
);
84+
```
85+
386
## 0.1.1 (2022-10-21)
487
588
### Features

packages/router-component-store/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngworker/router-component-store",
3-
"version": "0.2.0-alpha.0",
3+
"version": "0.2.0",
44
"description": "An Angular Router-connecting NgRx component store.",
55
"license": "MIT",
66
"peerDependencies": {

0 commit comments

Comments
 (0)