Skip to content

Commit

Permalink
chore: release v0.2.0 (#279)
Browse files Browse the repository at this point in the history
- Bump major prerelease version to reflect breaking changes
- Add release notes with migration guides to the changelog
  • Loading branch information
LayZeeDK committed Oct 24, 2022
1 parent f314c63 commit f561e15
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,88 @@
# Router Component Store changelog

## 0.2.0 (2022-10-24)

### Features

- Remove type parameter from `selectQueryParam`
- Specify observable type returned from `selectQueryParam`
- Remove type parameter from `selectRouteParam`
- Specify observable type returned from `selectRouteParam`

### **BREAKING CHANGES**

#### Stricter signature for selectQueryParam

Signature before:

```typescript
selectQueryParam<TValue>(param: string): Observable<TValue>;
```

Signature after:

```typescript
selectQueryParam(param: string): Observable<string | undefined>;
```

##### Migration

Loose types now yield compilation errors. Remove the type parameter to use the
actual emitted type of `string | undefined` and optionally use operators to
change or narrow the type.

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 signature for selectRouteParam

Signature before:

```typescript
selectRouteParam<TValue>(param: string): Observable<TValue>;
```

Signature after:

```typescript
selectRouteParam(param: string): Observable<string | undefined>;
```

##### Migration

Loose types now yield compilation errors. Remove the type parameter to use the
actual emitted type of `string | undefined` and optionally use operators to
change or narrow the type.

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),
);
```
## 0.1.1 (2022-10-21)
### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/router-component-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngworker/router-component-store",
"version": "0.2.0-alpha.0",
"version": "0.2.0",
"description": "An Angular Router-connecting NgRx component store.",
"license": "MIT",
"peerDependencies": {
Expand Down

0 comments on commit f561e15

Please sign in to comment.