Closed ThibaudAV closed 6 years ago
I think we should add:
(propertyDescriptor.value as any) = function(..._parameters) {
let parameters = JSON.parse(JSON.stringify(_parameters));
Yeah that makes sense, since you are passing a referential type, the stringify comparison that's done later will always return true. Can you make a PR about that and I will merge it and re-publish as soon as I can :) Thanks!
Hi,
I would like to run this test in
cacheable.decorator.spec.ts
Wouldn't it miss a clone of the parameters before saving them as old parameters. or something like that ?
Thank you for your help 🙂
UPDATE :
If you add cloneDeep of the parameters before the call to the "cacheable observable" it corrects the problem. But I still think it's up to the lib to do the job 🙂
If I find what I need to modify in the library, I will propose a PR 😉