Don't make my toSignal mistake in Angular

  Рет қаралды 7,802

Joshua Morony

Joshua Morony

Күн бұрын

Пікірлер: 26
@JoshuaMorony
@JoshuaMorony 4 ай бұрын
Join the weekly newsletter: mobirony.ck.page/4a331b9076
@moitp2
@moitp2 4 ай бұрын
I am not sure to understand why this is not set by default tbh
@dev_bits
@dev_bits 11 күн бұрын
This kind of tips what the developers need. Thanks.
@StephenMoreira
@StephenMoreira 4 ай бұрын
Short and sweet, thanks for the tip.
@andresmauriciofajardoolaya2721
@andresmauriciofajardoolaya2721 4 ай бұрын
Thanks for the content Joshua
@dinysanchez
@dinysanchez 4 ай бұрын
Thanks Joshua!
@DorianDauphin
@DorianDauphin 4 ай бұрын
Thanks for the content, Joshua. In a previous video, you stated that we should use Signal for synchronous tasks and RxJS when dealing with asynchronous tasks, but this still isn't very clear to me. It would be nice if you could make a video with simple examples showing when it is more appropriate to use signals over RxJS, or vice versa. Have a good day !
@valsimot-pod-dunavom
@valsimot-pod-dunavom 4 ай бұрын
great video, thanks for the info :D
@g-luu
@g-luu 4 ай бұрын
Great one thanks
@trevormontgomery6795
@trevormontgomery6795 4 ай бұрын
I think this might be my problem in something I'm working on. I was getting what seems like a recursion error when I make an http call. An error must be occurring and angular things I've got a recursive function
@shreyanshjain9479
@shreyanshjain9479 4 ай бұрын
That's really cool trick❤
@ianokay
@ianokay 4 ай бұрын
Very useful information from the cutting edge, nice video thanks. Unfortunate that it seems you have to spam every toSignal in your application with that object property if you want centralized error handling.
@JoshuaMorony
@JoshuaMorony 4 ай бұрын
I suppose you could also write a little helper utility if you wanted to have it by default everywhere
@PavelKostenko
@PavelKostenko 4 ай бұрын
What code editor are you using, is this nvim inside tmux? Please share your setup
@JoshuaMorony
@JoshuaMorony 4 ай бұрын
Yes it is - this video is somewhat old but covers most of what I am using: kzbin.info/www/bejne/hma0gZSZr5dgl9E I do have a couple other videos I think that talk about various aspects of my workflow/neovim setup
@anon5992
@anon5992 4 ай бұрын
how can we utilize @error with this approach?
@richardscholten100
@richardscholten100 2 ай бұрын
Why Is It When Something Happens, It's Always You RxJS? Thanks, exactly the problem i was facing...
@christianhalaby832
@christianhalaby832 4 ай бұрын
do you think not using signals at all is a set back?
@svenson95
@svenson95 4 ай бұрын
I don't really understand what you're doing in 1:50, the as const suffixes. What is happening there? it seems like the status property (a string) gets transformed to a variable / constant. I've never seen this before.
@RodrigoSalesSilva
@RodrigoSalesSilva 4 ай бұрын
by default if you set a string to any variable the type will be infered as string, but if you use as const the type will be infered as the exact string, like "let a = 'authenticated' as const" the type of "a" will be infered as 'authenticated', otherwise it would be 'string'.
@svenson95
@svenson95 4 ай бұрын
@@RodrigoSalesSilva okay interesting, but what is the benefit of having this status property not as type string but the actual value? In the next slide (2:01) we're just checking if the status value is "error", if i'm not wrong. Sorry if this is obvious, i feel kind of stupid right now :D
@JoshuaMorony
@JoshuaMorony 4 ай бұрын
​@@svenson95 this stream needs to return status values that match a union type of "initial | authenticating | authenticated | error", if I return just "error" for example it won't let me do that because type "string" is not assignable to that union type. If I use "as const" the specific string "error" does match that type.
@sergiokagiema9658
@sergiokagiema9658 4 ай бұрын
Where are the 4 reads that procude 4 triggers ?
@JoshuaMorony
@JoshuaMorony 4 ай бұрын
I think in the example the signal value is only actually referenced once, but it will depend on how many times change detection is triggered - so even if you only accessed the signal once in the template, but CD ran 4 times, it would cause 4 reads
@sergiokagiema9658
@sergiokagiema9658 4 ай бұрын
I see, I got it! Thanks for clarifying it!
@leolanese
@leolanese 4 ай бұрын
...{rejectErrors: true} nice 👍
I bet you can understand NgRx after watching this video
22:48
Joshua Morony
Рет қаралды 175 М.
ngTemplateOutlet is WAY more useful than I realised
16:36
Joshua Morony
Рет қаралды 73 М.
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 37 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 54 МЛН
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 41 МЛН
Why Angular Signals? Write Your First Signal
14:25
Angular University
Рет қаралды 8 М.
The mindset you need for a DECLARATIVE code refactor
7:56
Joshua Morony
Рет қаралды 11 М.
Here's what I've figured out about Angular signals
8:33
Joshua Morony
Рет қаралды 15 М.
Error Handling in Angular - Complete Guide (2022)
41:27
Decoded Frontend
Рет қаралды 65 М.
TOP 6 Mistakes in RxJS code
18:35
Decoded Frontend
Рет қаралды 16 М.
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 90 М.
Content Projection in Angular - Complete Guide (Beginners/Advanced)
26:18
Modern JS Toolchains (Biome, Oxc + More)
47:52
Syntax
Рет қаралды 3,6 М.
Why I decided to switch to the inject() function in Angular
6:10
Joshua Morony
Рет қаралды 55 М.
The CLEANEST authentication I've ever built with Angular
9:50
Joshua Morony
Рет қаралды 34 М.
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН