-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
function defineReactive (obj, key, val, cb) {
let val = val
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: ()=>{
/*....依赖收集等....*/
/*Github:https://github.com/answershuto*/
return val
},
set:newVal=> {
val = newVal;
cb();/*订阅者收到消息的回调*/
}
})
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels