The problem with Angular Signals and Async Reactivity

  Рет қаралды 1,100

Zoaib Khan

Zoaib Khan

Күн бұрын

#angular #signals #rxjs
💖 The complete app I was building can be found on my shop
buymeacoffee.com/zoaibkhan/e/...
📽️ My courses:
zoaibkhan.com/courses
✍️My blog for more free Angular posts:
zoaibkhan.com/blog
In this video, I discuss a problem I got with implementing a very common front-end problem using the Signals API in Angular. And the best way to resolve it!
Socials:
Twitter - / zoaibdev
Facebook - / thisiszoaib
LinkedIn - / zoaib-khan-b6456815
00:00 Introduction to Angular's Signals API Challenge
00:25 Exploring the Initial Approach with ngOnInit
02:10 Addressing Reactivity with Effects Primitive
04:25 Switching to RxJS for Enhanced Reactivity
06:36 Optimizing with Observable to Signal Conversion
08:54 Introducing Derived Async for Simplified Implementation
10:43 Conclusion and Final Thoughts
Cheers!

Пікірлер: 18
@elsecoding8691
@elsecoding8691 2 ай бұрын
This is good stuff. Thanks for sharing 👍👍
@ZoaibKhan
@ZoaibKhan 2 ай бұрын
My pleasure :)
@flywheel56
@flywheel56 3 ай бұрын
Pertinent, useful, and very up to date info on the new way of working with Angular. Thanks.
@ZoaibKhan
@ZoaibKhan 3 ай бұрын
You're welcome 🤗
@PatricioHondagneuRoig
@PatricioHondagneuRoig 3 ай бұрын
Cool video, very informative take. Thanks for sharing!
@ZoaibKhan
@ZoaibKhan 3 ай бұрын
Glad you found it useful! :)
@MichaelSmallDev
@MichaelSmallDev 3 ай бұрын
I'm pretty sure some feature I wrote today would have been easier if I saw this first. I may just refactor it to be more like this video. Good stuff.
@ZoaibKhan
@ZoaibKhan 3 ай бұрын
Glad to hear you found it useful! There's also the ngrx signals package and it's rxMethod function - that does the same thing in an RxJS way...
@WeAreMuslim320
@WeAreMuslim320 3 ай бұрын
Please also upload videos in urdu for better understanding thanks a lot.
@KostasOreopoulos
@KostasOreopoulos 2 ай бұрын
Or we can wrap the signal sets in an untracked scope I guess. But looking at the source code of derivedAsync, its very very clever.
@ZoaibKhan
@ZoaibKhan 2 ай бұрын
Oh, I haven't looked at it in detail myself. Can you share some of the clever stuff there? :)
@KostasOreopoulos
@KostasOreopoulos 2 ай бұрын
@@ZoaibKhan It converts the promise if given to an observable, flattens it, uses DestroyRef, which I have never heard of to unsubscribe on destroy, peaks on the initial value in an untracked scope to avoid recursion, does the computation in an untracked scope, and gives back a computed signal based on the objeservable's next value. Its a little bit confusing because it tries to handle a lot of function signatures in the same function
@ZoaibKhan
@ZoaibKhan 2 ай бұрын
@@KostasOreopoulos Wow, that's quite a lot! Respect for the maintainers increased even more :)
@arpitgarg6459
@arpitgarg6459 3 ай бұрын
why can't we used computed in place of derviedAsync?
@ZoaibKhan
@ZoaibKhan 3 ай бұрын
Because computeds are meant for sync reactivity, they can't have delays or promises or anything async in them.
Building a Multi-level Angular Sidebar with Recursion!
25:02
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 39 МЛН
I tested Angular 18 Zoneless mode and this is what I found out!
16:24
🚦 Angular NgRx Signal Store Crash Course (For NgRx Beginners)
1:08:54
Angular University
Рет қаралды 15 М.
Computed Signals and Effects in-depth | Angular Signals |
22:23
NomadCoder
Рет қаралды 2,5 М.
Angular and Angular Three with Chau
1:30:40
Tech Talks With Santosh
Рет қаралды 1 М.
Angular Signals. А точно ли нужен? Как работает магия сигналов
25:15
Архитектор ПО. Александр Желнин
Рет қаралды 9 М.
Why Angular Signals? Write Your First Signal
14:25
Angular University
Рет қаралды 8 М.
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 90 М.
Are you using Angular Signal Effects in the RIGHT way?
11:13
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 125 М.
Senior Angular Developer Interview (theory)
41:57
WeCoded
Рет қаралды 13 М.
low battery 🪫
0:10
dednahype
Рет қаралды 1,6 МЛН
8 Товаров с Алиэкспресс, о которых ты мог и не знать!
49:47
РасПаковка ДваПаковка
Рет қаралды 172 М.