Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions projects/ngrx.io/content/guide/migration/v12.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,48 @@ Version 12 has the minimum version requirements:
- TypeScript version 4.2.x
- RxJS version 6.5.x

## Breaking changes
## Deprecations

TBD
### @ngrx/store

#### Selectors With Props

Selectors with props are deprecated in favor of "normal" factory selectors.
Factory selectors have the following benefits:

- easier to write and to teach
- selectors are typed
- child selectors are correctly memoized

BEFORE:

```ts
const selectCustomer = createSelector(
selectCustomers,
(customers, props: { customerId: number }) => {
return customers[customerId];
}
);

// Or if the selector is already defined as a factory selector

const selectCustomer = () =>
createSelector(
selectCustomers,
(customers, props: { customerId: number }) => {
return customers[customerId];
}
);
​```

AFTER:

```ts
const selectCustomer = (customerId: number) =>
createSelector(
selectCustomers,
(customers) => {
return customers[customerId];
}
);
```