Tencent / omi

Web Components Framework - Web组件框架

Home Page:http://omijs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can we implement a delete function in obaa?

fehmi opened this issue · comments

Just like the set and add functions. Is it possible to do that for delete also?

  obaa.add = function (obj, prop) {
    watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_)
  }

  obaa.set = function (obj, prop, value) {
    if (obj[prop] === undefined) {
      watch(obj, prop, obj.__o_.__p_, obj.__o_.__r_)
    }
    obj[prop] = value
  }

Sure. Welcome to pr :)

I will try that. Thank you!