Add __raw
property to listener proxies
This commit is contained in:
parent
be61a88f55
commit
13f8ba591a
1 changed files with 2 additions and 1 deletions
|
@ -23,7 +23,6 @@ export default (target={}) => {
|
||||||
}
|
}
|
||||||
let proxy = new Proxy(target, {
|
let proxy = new Proxy(target, {
|
||||||
set: (target, prop, value) => {
|
set: (target, prop, value) => {
|
||||||
console.log(callbacks)
|
|
||||||
if (callbacks.has("*")) callbacks.get("*").forEach(callback => callback(value, prop, target[prop]))
|
if (callbacks.has("*")) callbacks.get("*").forEach(callback => callback(value, prop, target[prop]))
|
||||||
if (callbacks.has(prop)) callbacks.get(prop).forEach(callback => callback(value, prop, target[prop]))
|
if (callbacks.has(prop)) callbacks.get(prop).forEach(callback => callback(value, prop, target[prop]))
|
||||||
return Reflect.set(target, prop, value)
|
return Reflect.set(target, prop, value)
|
||||||
|
@ -31,6 +30,8 @@ export default (target={}) => {
|
||||||
get: (target, prop, value) => {
|
get: (target, prop, value) => {
|
||||||
if (prop == "listen")
|
if (prop == "listen")
|
||||||
return listen
|
return listen
|
||||||
|
else if (prop == "__raw")
|
||||||
|
return target
|
||||||
else
|
else
|
||||||
return Reflect.get(target, prop)
|
return Reflect.get(target, prop)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue