Fork me on GitHub
Ramon Rios15:05:58

Does interceptors are a good way/best practice to validate/show errors?

Ramon Rios15:05:48

I want to start to work with validations on my app and i don't know where to start


Initially I did it via interceptors, yes. But later I realized that I didn't need to have the validation issues in the DB - I just needed to display them in the UI. So I ended up switching to validation within subscriptions. Apart from resulting in a simpler workflow, it also results in better performance if you use subscription signals. That way, no validation will run twice on the same input.


@UNST81B9P I have done it both ways, subscriptions and interceptors, both work fine. If using interceptors, usually using rf/on-changes