-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
hi, I am trying to use lib proxy-memoize in our website to replace reselect
, but our website serves customers, so need be compatible with as many browsers as possible, but proxy-polyfill
can't work with this lib, since the polyfill only support a limited scope traps, not include has
, deleteProperty
and so on.
I also take a look of immerjs
to check how it works in non-proxy environment, it use Object.defineProperty
instead, so what I think is:
- add a condition
setUseProxies
to disable using Proxy. - have a backup
Object.defineProperty
implementation, for this scenario, only support limit recording method.- record traps
get
andset
getOwnPropertyDescriptor
andownKeys
are rarely used and also reasonable if not record them.has
anddeleteProperty
are big problems, only hope the developers notice to don't use them.obj['a']
instead of'a' in obj
const { ...newObj, a } = obj
instead ofdelete obj.a
- record traps
then I think proxy-memoize
can have a widely usage scenarios, hope can as a default selectorCreator be putted in the redux-toolkit one day ^_^
Metadata
Metadata
Assignees
Labels
No labels