Lesson

Customize Assignment Behavior with a Proxy Handler

Proxies allow you to hijack the default process of assigning a value to a property on an object. Create a Proxy and link the object you want to proxy to the handler then you can define the behavior inside of a set function on the handler. The simplest example...

Duration
4 min
Access
Free
Transcript
Available

Proxies allow you to hijack the default process of assigning a value to a property on an object. Create a Proxy and link the object you want to proxy to the handler then you can define the behavior inside of a set function on the handler. The simplest example is to create a logging behavior which would log out the previous and next values before the value has changed.