andreypopp / andreypopp/memoize-decorator
Make stored value non-enumerable.
Open
- Dominant language
- JavaScript
- Stars
- 30
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
The memoized value is currently stored in an enumerable property (`_memoized_xxx`), but this messes up deep equality comparisons. The solutions to this would either be:
* Keep the same property name but set it using `Object.defineProperty` with enumerable set to false.
* Use symbols instead of a magic property name.
* Use WeakMaps, similar to the above.
What do you think?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.