tserkov / vue-sse

A Vue plugin for using Server-Sent Events (EventSource).
MIT License
149 stars 37 forks source link

Feature: Add "interceptor" #22

Open sbernard31 opened 3 years ago

sbernard31 commented 3 years ago

axios library provide an interceptor feature : https://github.com/axios/axios#interceptors

This is a useful idea to be able to apply a generic default behavior to all request. This is pretty useful for example to handle error in a generic way.

Maybe this could be a good feature for vue-sse.

tserkov commented 3 years ago

Great suggestion! Not much trouble to actually get it added as well, since I already break out each message type into a single handler.

I'll add it to the roadmap.