Skip to content

Refactor: Modernize budget viewer state with Signals#193

Open
Patmut254 wants to merge 9 commits intoitalanta:mainfrom
Patmut254:feat/add-budget-note-command
Open

Refactor: Modernize budget viewer state with Signals#193
Patmut254 wants to merge 9 commits intoitalanta:mainfrom
Patmut254:feat/add-budget-note-command

Conversation

@Patmut254
Copy link
Copy Markdown

How I Did This
I replaced RxJS observables with Angular signals. Changed constructor injection to inject(), converted observables using toSignal(), and used computed() to combine data. Replaced subscriptions with effect() for side effects. Updated templates to pass signal values directly.
Why Signals Are Better Here
Signals are simpler - just call mySignal() to get values. No subscriptions to manage, no memory leaks. The code is cleaner and faster because signals only update what changed, not everything.
Signals vs Observables
Observables are streams of data over time (like button clicks). Signals hold current state (like current user). Observables need subscribe/unsubscribe. Signals handle cleanup automatically. For UI state like budgets, signals are more natural.
Other Paradigm
I've used React hooks. They're simpler to learn but re-render entire components. Signals are faster - they update only what changed.

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.

2 participants