Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for global interceptors #192

Open
LifeIsStrange opened this issue Oct 20, 2021 · 1 comment
Open

Add support for global interceptors #192

LifeIsStrange opened this issue Oct 20, 2021 · 1 comment
Labels
enhancement Suggests, requests, or implements a feature or enhancement

Comments

@LifeIsStrange
Copy link

LifeIsStrange commented Oct 20, 2021

Axios has a standard feature called interceptors. It allow to run custom functions before onSuccess and onError, which is very expressive and allow to make along other things, normalization, validation, retries and reuse of code.

@viglucci
Copy link
Member

viglucci commented Oct 27, 2021

Hi @LifeIsStrange, thanks for providing the proposal for interceptor support. While our current focus in the 1.0/dev branch remains on meeting spec compliance and core features, our goal is certainly to allow for features such as interceptors to be easier to achieve. Additionally, we likely see features such as the proposed being provided externally via extension packages, rather than as a core feature of rsocket-js. With the existing API implemented to satisfy #158, I believe achieving the proposed interceptors would be achievable using such an extension package.

For an example of such an "extension", we briefly experimented with an rxjs extension to wrap the core API: https://github.com/rsocket/rsocket-js/blob/feature/dev-rxjs-extension/packages/rsocket-examples/src/rxjs-extension/extension.ts.

With that being said, we can certainly keep this in mind as development on #158 continues, however, we may not be able to commit to the request at this time.

@viglucci viglucci added the enhancement Suggests, requests, or implements a feature or enhancement label Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Suggests, requests, or implements a feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants