Skip to content

Adopt Angular signals for reactive state - #611

Merged
dcaslin merged 2 commits into
masterfrom
dcaslin/angular-signals
Apr 6, 2026
Merged

Adopt Angular signals for reactive state#611
dcaslin merged 2 commits into
masterfrom
dcaslin/angular-signals

Conversation

@dcaslin

@dcaslin dcaslin commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Convert AppStateService BehaviorSubjects to WritableSignal (6 fields: disableAds, debugmode, favoritesList$, favoritesMap, hiddenMilestones, hiddenClanMilestones)
  • Convert ChildComponent.loading from BehaviorSubject to signal(false)
  • Convert loading BehaviorSubjects to signals in 7 services/components (StreamingService, GearService, ClanStateService, FriendStarComponent, PerkbenchComponent, DimSyncService, MarkService)
  • Update 54 templates: replace field | async with field() signal reads
  • Replace .next() with .set() and .getValue() with () across 24 TS files
  • Remove AsyncPipe import from 11 components that no longer use it
  • Convert FriendsComponent.members to signal, use effect() for reactive derivation from favoritesList$
  • Version bumped to 29.4.0

What stays as Observable

  • PlayerStateService (complex: private subjects + public .asObservable() pattern)
  • ClanStateService non-loading subjects (many BehaviorSubjects with rich usage)
  • GearFilterStateService observables
  • All HTTP/streaming observables

Verification

  • ng build — clean ✅
  • ng build --configuration production — 2.98 MB initial bundle ✅
  • npm run lint — 0 errors ✅

Test plan

  • CI build passes
  • Smoke test: home page, player profile, gear manager, clan pages, friends list
  • Verify loading spinners still appear/disappear correctly
  • Verify debug mode toggle works (settings → all pages showing debug info)
  • Verify friend star add/remove updates correctly

🤖 Generated with Claude Code

dcaslin and others added 2 commits April 5, 2026 20:47
Convert BehaviorSubjects to WritableSignals in AppStateService,
ChildComponent, and 7 service-level loading flags. Replace | async
pipe with signal() reads in 54 templates. Replace .next() with .set()
and .getValue() with () across 24 TS files. Remove AsyncPipe import
from 11 components that no longer need it. Convert FriendsComponent
members to signal with effect() for reactive state derivation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dcaslin
dcaslin merged commit 4f6885d into master Apr 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant