teamleadercrm / sdk-js

MIT License
6 stars 0 forks source link

Cache the values that are created by the proxy #332

Closed lowiebenoot closed 2 years ago

lowiebenoot commented 2 years ago

Before this change, if you were using and endpoint 2 times, it would call a different function 2 times. This is very annoying if you are writing tests and expecting a certain endpoint to be called.

A lot of our tests were failing because it expected an endpoint to be called, but since it's always a new function, the functions didn't get called.

Solved if by caching the created functions in an object. If the endpoint has already been called, it will return the previously created function.

Should we release this as a patch or as a minor update?

driesd commented 2 years ago

Seems like a minor update to me

lowiebenoot commented 2 years ago

Was more thinking of a patch as well, so going to release it as a patch 👍