gund / ng-http-interceptor

Http Interceptor library for Angular
MIT License
104 stars 16 forks source link

add context to share data between interceptors #92

Closed JiaLiPassion closed 7 years ago

JiaLiPassion commented 7 years ago

Based on #50, add a context to share data between interceptors, to keep the current interface unchange, use a interceptorZone to share data.

to set data in context.

  let interceptor = (data, method, context) => { 
        if (context) context['key'] = 'value';
        return data;
    }

    let otherInterceptor = (data, method, context) => { 
        if (context) let sharedData = context['key'];
        return data;
    }
codecov-io commented 7 years ago

Current coverage is 100% (diff: 100%)

Merging #92 into master will not change coverage

@@           master   #92   diff @@
===================================
  Files          13    13          
  Lines         179   180     +1   
  Methods        42    42          
  Messages        0     0          
  Branches       25    25          
===================================
+ Hits          179   180     +1   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 61adb7c...90a90cb

JiaLiPassion commented 7 years ago

Sorry for the late reply, I didn't receive the email notification, I have make the change, and please review, thank you.