Closed Doogiemuc closed 6 years ago
Still no idea. Please help. Anyone?
Interceptors can receive configuration when they wrap a client. That config is passed into each interceptor phase method.
const cachingInterceptor = interceptor({
request(req, config) {
...
},
response(res, config) {
...
}
});
rest.wrap(cachingInterceptor, { cache: cacheImpl })
Thank you for that tip. It worked fine.
I have written a cachingInterceptor. Basically my interceptor is structured very similar to the pathPrefix.js example.
The pathPrefix example has two "private" methods startsWidth() and endsWith(). My cachingInterceptor als has methods like this, e.g. purgeCache() or setTTL()
=> How can I make these methods accessible from a module that only knonws the outer cujoJS rest "client". I mean, the client that might be wrapped in several interceptors.