gullerya / object-observer

Object Observer functionality of JavaScript objects/arrays via native Proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

externalize `[un]observe` API - eliminate source modification

gullerya opened this issue · comments

Right now, there are 2 methods that are set on the source object when turned into Observable: observe and unobserve, thus 'patching' the source, which is not perfect.

As per discussion in issue #110 and as suggested by @Stnaire those method may reside as a static once on the Observable factory, while the observable instance self remain unchanged, something like:

const observable = Observable.from(source);
Observable.observe(observable, () => {...});

If this path will prove itself and be taken, roadmap should be:

  • add the new APIs in v4 (current one)
  • remark the old APIs as deprecated in v4
  • drop old APIs starting from v5