developit / decko

:dash: The 3 most useful ES7 decorators: bind, debounce and memoize
https://developit.github.io/decko/
MIT License
1.03k stars 36 forks source link

Don't think @memorize fit any case. #13

Open mrdulin opened 6 years ago

mrdulin commented 6 years ago

I saw you use first argument as key of cache. What if the first argument is an object, like this:

const a = {};
const b = {c: {}}
String(a) //"[object Object]"
String(b) //"[object Object]"

Besides, can you provide any benchmark tests? I don't think it fit any case.

developit commented 6 years ago

It only supports primitive values. This is the reason it is fast.