Closed tareqimbasher closed 9 years ago
I think right now you'd need to pass your replacer at request creation time instead of at configuration time so it's not shared by all requests. It'd probably be better if the withReplacer
helper took a function that returned a replacer, so we could create a new one for each request. Care to open a PR? :-)
Closing for now. The reviver/replacer can be passed per request instead of as part of the global config.
Hello everyone, I am configuring the HttpClient with a replacer to JSON.stringify like this:
JsonStringifyReplacer
:My problem: This works once, but the cache array is never emptied for the next time the replacer needs to be used.
I also cannot do this:
because then the cache will be reinitialized for every member the JSON.stringify method is trying to stringify, which defeats the purpose, since the cache is always new. Any ideas on how to solve this?I thought up some elaborate solutions in my head, but I think I may be over complicating things.