Is this how we will handle errors reactively with signals in Angular?

Is this how we will handle errors reactively with signals in Angular?

Joshua Morony

1 год назад

13,465 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@chaos_monster
@chaos_monster - 03.05.2023 15:17

I would love to start a discussion about the usage of services in the template. I am probably old school and would argue that everything injected should be private and therefor not directly accessible in the template

About your video - I really like the thoughts and approach you've taken and would currently also tend to go that route

Ответить
@andresmauriciofajardoolaya2721
@andresmauriciofajardoolaya2721 - 03.05.2023 15:40

I like this approach that you mention :)

Ответить
@Sevkingblade
@Sevkingblade - 03.05.2023 16:00

This approach is nice. I like it

Ответить
@julienwickramatunga7338
@julienwickramatunga7338 - 03.05.2023 16:03

Nice approach, clever 👍

Ответить
@NoName-1337
@NoName-1337 - 03.05.2023 17:14

Your solution is a little bit like a "Result" in Rust. Looks nice.

Ответить
@dimitritsikaridze6220
@dimitritsikaridze6220 - 03.05.2023 17:30

why did you switch to neovim?

Ответить
@endlacer
@endlacer - 03.05.2023 17:43

And what about a retry-button for example. After it the rxjs-stream (getFromApiError()) errors, isn't it "dead"? how would you go about implementing a retry which results are delivered in the same rxjs stream?

Ответить
@lucasgiunta8874
@lucasgiunta8874 - 03.05.2023 17:44

How to manage with this package the case of different error management in a stream who includes multiple call trough switchMap operator ? Like if something, stop the calls and display a banner, if something else retryWhen operator ?

Ответить
@cloudsss83
@cloudsss83 - 03.05.2023 18:04

You are a legend, mate. Any plans for a promotion of Ionic Start? Help your fellow Brazilians lol

Ответить
@cosmokenney
@cosmokenney - 03.05.2023 18:47

You lost me at of(null)...

Ответить
@billiamdur
@billiamdur - 03.05.2023 22:42

Getting kind of async/await/promise handling vibe from this. :)

Ответить
@stevenrobson
@stevenrobson - 04.05.2023 09:44

Clean intuitive approach. I see this becoming a common practice.

Ответить
@CorentinClichy
@CorentinClichy - 04.05.2023 14:48

Always qualitative and well explained stuff ! Thanks a lot !

Ответить
@scottfwalter
@scottfwalter - 04.05.2023 15:52

Love this approach!

Ответить
@kapobajza3708
@kapobajza3708 - 04.05.2023 17:33

Isn't there a drawback to this approach if you want to show the data and the error at the same time? For example if you have already fetched your data once and then an error occurs the second you fetch your data, value will be undefined. Therefore you won't be able to display your data and the error simultaneously.

Ответить
@Szergej33
@Szergej33 - 04.05.2023 18:22

This is a good video and nice explanation.

Creating a NPM package for 20 lines of code that can easily be copy-pasted is everything that's wrong with the JS ecosystem though :D

Ответить
@Blafasel3
@Blafasel3 - 04.05.2023 23:04

I love the approach! Its basically the Either<Success, Error> pattern in a reactive way :) the helper function should make writing stuff like this much easier.

Ответить
@briancepon6402
@briancepon6402 - 07.05.2023 02:02

Very nice way of keeping things reactive as they evolve ! thank you !

Ответить
@AlainBoudard
@AlainBoudard - 08.05.2023 10:23

Pretty clean pattern I think ! Nice catch 🙂

Ответить
@HarveyDaclan
@HarveyDaclan - 09.05.2023 12:40

I like the approach! Very clean and straight forward. Thanks! Do you know if we need to unsubscribe a long running observable inside a toSignal function?

Ответить
@piotrsobus9340
@piotrsobus9340 - 11.05.2023 23:51

This is a pattern that I have been using for quite some time and it's pretty handy. You can also use materialize operator instead of map + catchError.

Ответить
@danielsmeyer
@danielsmeyer - 16.05.2023 06:32

I think it's a neat approach. Will test today. 😊

Ответить
@КонстантинХ-у4ф
@КонстантинХ-у4ф - 23.05.2023 20:30

yur method do not work with update, mutate etc. it is fail

Ответить
@PieJee1
@PieJee1 - 31.05.2023 06:39

I used similar structures before signaljs was a thing. Not for signaljs but more for fellow developers having a hard time reading rxjs pipes.

Ответить
@joeyvico
@joeyvico - 21.11.2023 21:09

Nice Joshua! Thanks

Ответить
@fabianvieri1907
@fabianvieri1907 - 17.05.2024 10:51

Clean approach!. I want to ask how do you handle for mutation request that can be called multiple times using signal?

Ответить
@masterkingmahendra
@masterkingmahendra - 03.10.2024 13:50

Like your video. Good approach but one thing is not clear if I have to pass ToSignalOptions like initialValue, requireSync etc. this is not possible with your utility function

Ответить