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 !
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.
A case is made for the errors, how do you handle success feedback, like showing success message. Especially if they are invoked by calling a service method?
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
Yes it is - this video is somewhat old but covers most of what I am using: th-cam.com/video/P5QPacz2-ao/w-d-xo.html I do have a couple other videos I think that talk about various aspects of my workflow/neovim setup
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.
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'.
@@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
@@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.
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
Join the weekly newsletter: mobirony.ck.page/4a331b9076
This kind of tips what the developers need. Thanks.
I am not sure to understand why this is not set by default tbh
Short and sweet, thanks for the tip.
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 !
Thanks for the content Joshua
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.
I suppose you could also write a little helper utility if you wanted to have it by default everywhere
A case is made for the errors, how do you handle success feedback, like showing success message. Especially if they are invoked by calling a service method?
Great one thanks
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
That's really cool trick❤
great video, thanks for the info :D
What code editor are you using, is this nvim inside tmux? Please share your setup
Yes it is - this video is somewhat old but covers most of what I am using: th-cam.com/video/P5QPacz2-ao/w-d-xo.html I do have a couple other videos I think that talk about various aspects of my workflow/neovim setup
how can we utilize @error with this approach?
do you think not using signals at all is a set back?
Why Is It When Something Happens, It's Always You RxJS?
Thanks, exactly the problem i was facing...
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.
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'.
@@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
@@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.
Where are the 4 reads that procude 4 triggers ?
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
I see, I got it! Thanks for clarifying it!
...{rejectErrors: true}
nice 👍
Thanks Joshua!