Skip to content

Commit 9dc418b

Browse files
author
Cyril Walle
committed
proxy
1 parent 495ce5e commit 9dc418b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

js/tricks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,18 @@ const slowVector3 = function ([x = required("x"), y = required("y"), z = require
111111
slowVector3([6, 8]); --> Error: required parameter z missing
112112
```
113113

114+
115+
## Proxy
116+
117+
```
118+
const handler = {
119+
/** Intercepts: getting properties */
120+
get(target, propKey, receiver) {
121+
console.log(`GET ${target} ${propKey} ${receiver}`);
122+
return Reflect.get(target, propKey, receiver);
123+
},
124+
125+
};
126+
127+
```
128+

0 commit comments

Comments
 (0)