Closed dai-shi closed 5 years ago
Proposal accepted, but I would write some tests before releasing it - it's more about properly mimicking babel behaviour. For example - Object.keys
might be not enough. Not sure - tests will show.
👷 still on it 👷
There were issues with your proposal, more about defineProperty
is not working on Proxies.
I've added two new APIs
proxyObjectRest(object, ['key'])
- to {key, ...rest}
, while access to key would be recorded, but rest
would be just copied.proxyArrayRest(array, fromIndex
to [a,b,...rest]
, and again access to a(0), and b(1) would be recorded, but not to the rest. In the same time indexes in the rest would be tracked using original indexes in the source object.
This is just a proposal. I didn't spend time to dive in deep.
This is the code I used in https://github.com/dai-shi/react-hooks-easy-redux/issues/8#issuecomment-474783286
The test is failing.