9Proxies and Reflect
WHAT'S IN THIS CHAPTER?
- Proxy fundamentals
- Proxy traps and reflect methods
- Proxy patterns
Freshly introduced in ECMAScript 6, proxies and reflection are totally new constructs that afford you the ability to intercept and shim additional behavior into fundamental operations within the language. More specifically, you can define a proxy object associated with a target object, and the proxy object can be used as an abstracted target object within which you can control what happens when various operations are performed before they actually reach the target object.
For developers approaching this subject for the first time, this is a fairly nebulous concept paired with a healthy corpus of new terminology. Working through multiple examples will help to cement your understanding.
PROXY FUNDAMENTALS
As mentioned in the chapter introduction, a proxy behaves as an abstraction for a target object. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access