Skip to content

Commit e77453b

Browse files
timdeschryverbrandonroberts
authored andcommitted
docs(www): add v21 migrations
1 parent 990f820 commit e77453b

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

  • projects/www/src/app/pages/guide/migration

projects/www/src/app/pages/guide/migration/v21.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,52 @@ Version 21 has the minimum version requirements:
2020
- RxJS version ^6.5.x || ^7.5.0
2121

2222
## Breaking changes
23+
24+
### @ngrx/signals
25+
26+
#### rename `withEffects` to `withEventHandlers`
27+
28+
The `withEffects` feature from the `@ngrx/signals/events` plugin is renamed to `withEventHandlers`.
29+
30+
BEFORE:
31+
32+
```ts
33+
import { withEffects } from '@ngrx/signals/events';
34+
35+
export const CounterStore = signalStore(
36+
withState({ count: 0 }),
37+
withEffects((store, events = inject(Events)) => ({
38+
logCount$: events
39+
.on(increment)
40+
.pipe(tap(() => console.log(store.count()))),
41+
}))
42+
);
43+
```
44+
45+
AFTER:
46+
47+
```ts
48+
import { withEventHandlers } from '@ngrx/signals/events';
49+
50+
export const CounterStore = signalStore(
51+
withState({ count: 0 }),
52+
withEventHandlers((store, events = inject(Events)) => ({
53+
logCount$: events
54+
.on(increment)
55+
.pipe(tap(() => console.log(store.count()))),
56+
}))
57+
);
58+
```
59+
60+
### @ngrx/eslint-plugin
61+
62+
The lint rules that require type information have been moved to seperate predefined configurations.
63+
64+
| Configuration | Configuration including type checked rules |
65+
| ---------------- | ------------------------------------------ |
66+
| `all` | `allTypeChecked` |
67+
| `componentStore` | N/A |
68+
| `effects` | `effectsTypeChecked` |
69+
| `operators` | N/A |
70+
| `signals` | `signalsTypeChecked` |
71+
| `store` | N/A |

0 commit comments

Comments
 (0)