Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Custom options to override in the response object #18

Open
barocsi opened this issue Jan 12, 2017 · 1 comment
Open

Custom options to override in the response object #18

barocsi opened this issue Jan 12, 2017 · 1 comment

Comments

@barocsi
Copy link

barocsi commented Jan 12, 2017

The case is the following:

  1. request made from view
  2. response 200, view processes result
  3. response 404 it is intercepted
  4. response object is returned to fulfill view promise or other subscribers
  5. I do not want view to catch the error nor to process the result because in 3. action was taken

in non typescript scenarios I was simply injected a property handled = true in the response object so the view/controller knew there is nothing further to do with the error message.

What is the best pattern to intercept and prevent bubbling but fulfill view/controller promises or observer subscribers?

Thanks

@thekalinga
Copy link

I have similar scenario aswell.

In OAuth2, if the refresh token is expired (which I will come to know when I send the request to server & get the response), I need to redirect the user to login page & don't want the interceptor chain(in the reverse order) to be executed.

So, there should be a provision to cancel the interceptor chain execution (interceptAfter) in the reverse order

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants