Skip to content

Commit 8ef6702

Browse files
chore: add ngrx toolkit
1 parent 0b951aa commit 8ef6702

File tree

9 files changed

+44
-37
lines changed

9 files changed

+44
-37
lines changed

package-lock.json

Lines changed: 23 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"zone.js": "~0.15.1"
4747
},
4848
"devDependencies": {
49+
"@angular-architects/ngrx-toolkit": "^20.0.1",
4950
"@angular-devkit/build-angular": "^20.1.3",
5051
"@angular-eslint/builder": "~20.1.1",
5152
"@angular-eslint/eslint-plugin": "~20.1.1",

src/app/business/store/business-status/business-statuses.store.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { map, switchMap } from 'rxjs/operators';
1212
import { tapResponse } from '@ngrx/operators';
1313
import { BusinessStatus } from 'swissparl';
1414
import * as _ from 'lodash';
15+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
1516
import {
1617
createDefaultRequestState,
1718
RequestState
@@ -34,6 +35,7 @@ const initialBusinessStatusesState: BusinessStatusesSlice = {
3435

3536
export const BusinessStatusesStore = signalStore(
3637
{ providedIn: 'root' },
38+
withDevtools('BusinessStatusesStore'),
3739
withState(initialBusinessStatusesState),
3840
withComputed((store) => {
3941
return {

src/app/business/store/business-types/business-types.store.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import {
2+
patchState,
23
signalStore,
3-
withState,
44
withComputed,
55
withMethods,
6-
patchState
6+
withState
77
} from '@ngrx/signals';
88
import { computed, inject } from '@angular/core';
99
import { rxMethod } from '@ngrx/signals/rxjs-interop';
1010
import { pipe, tap } from 'rxjs';
1111
import { switchMap } from 'rxjs/operators';
1212
import { tapResponse } from '@ngrx/operators';
1313
import { BusinessType } from 'swissparl';
14+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
1415
import {
1516
createDefaultRequestState,
1617
RequestState
@@ -33,6 +34,7 @@ const initialBusinessTypesState: BusinessTypesState = {
3334

3435
export const BusinessTypesStore = signalStore(
3536
{ providedIn: 'root' },
37+
withDevtools('BusinessTypesStore'),
3638
withState(initialBusinessTypesState),
3739
withComputed((store) => {
3840
return {

src/app/business/store/business/business.store.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import {
2+
getState,
3+
patchState,
24
signalStore,
3-
withState,
45
withComputed,
56
withMethods,
6-
patchState,
7-
getState
7+
withState
88
} from '@ngrx/signals';
99
import { computed, inject } from '@angular/core';
1010
import { rxMethod } from '@ngrx/signals/rxjs-interop';
1111
import { filter, pipe, tap } from 'rxjs';
1212
import { switchMap } from 'rxjs/operators';
1313
import { tapResponse } from '@ngrx/operators';
1414
import { Business } from 'swissparl';
15+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
1516
import {
1617
createDefaultRequestState,
1718
RequestState
@@ -54,6 +55,7 @@ const initialState: BusinessSlice = {
5455

5556
export const BusinessStore = signalStore(
5657
{ providedIn: 'root' },
58+
withDevtools('BusinessStore'),
5759
withState(initialState),
5860
withComputed((store) => {
5961
return {

src/app/council-member/store/council-member/council-member.store.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { filter, pipe, tap } from 'rxjs';
1212
import { switchMap } from 'rxjs/operators';
1313
import { MemberCouncil } from 'swissparl';
1414
import { tapResponse } from '@ngrx/operators';
15+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
1516
import {
1617
CouncilMemberFilter,
1718
CouncilMemberService
@@ -54,6 +55,7 @@ const initialState: CouncilMemberState = {
5455

5556
export const CouncilMemberStore = signalStore(
5657
{ providedIn: 'root' },
58+
withDevtools('CouncilMemberStore'),
5759
withState(initialState),
5860
withComputed((store) => {
5961
return {

src/app/council-member/store/voting-record/voting-record.store.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { pipe, tap } from 'rxjs';
1111
import { switchMap } from 'rxjs/operators';
1212
import { tapResponse } from '@ngrx/operators';
1313
import { computed, inject } from '@angular/core';
14+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
1415
import {
1516
createDefaultRequestState,
1617
RequestState
@@ -34,6 +35,7 @@ const initialVotingRecordState: VotingRecordSlice = {
3435

3536
export const VotingRecordStore = signalStore(
3637
{ providedIn: 'root' },
38+
withDevtools('VotingRecordStore'),
3739
withState(initialVotingRecordState),
3840
withComputed((store) => {
3941
return {

src/app/votes/components/vote-card/vote-card.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
Component,
33
computed,
4-
effect,
54
inject,
65
input,
76
OnInit

src/app/votes/store/vote/vote.store.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
import { computed, inject } from '@angular/core';
1010
import { rxMethod } from '@ngrx/signals/rxjs-interop';
1111
import { filter, pipe, tap } from 'rxjs';
12-
import { mergeMap, switchMap } from 'rxjs/operators';
12+
import { switchMap, mergeMap } from 'rxjs/operators';
13+
import { withDevtools } from '@angular-architects/ngrx-toolkit';
1314
import { Vote } from 'swissparl';
1415
import { tapResponse } from '@ngrx/operators';
1516
import {
@@ -24,8 +25,8 @@ import {
2425
createRefreshState,
2526
createSuccessVotesAppendRequestState,
2627
createSuccessVotesRequestState,
27-
createUpsertDetailedVoteState,
28-
patchQueryState
28+
patchQueryState,
29+
createUpsertDetailedVoteState
2930
} from './vote.updaters';
3031
import {
3132
createVoteDetailVm,
@@ -51,6 +52,7 @@ const initialState: VoteSlice = {
5152

5253
export const VoteStore = signalStore(
5354
{ providedIn: 'root' },
55+
withDevtools('VoteStore'),
5456
withState(initialState),
5557
withComputed((store) => {
5658
return {

0 commit comments

Comments
 (0)