atom / etch

Builds components using a simple and explicit API around virtual-dom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No scheduler is ever set

thomasjo opened this issue · comments

The result is that any call to etch.update, or attempts to use etch.observe fails with

Cannot read property 'updateDocument' of null

which originates in element-prototype.js from the update function

update: {
  value: function () {
    if (!this._updateRequested) {
      this._updateRequested = true
      getScheduler().updateDocument(() => {
        this._updateRequested = false
        this.updateSync()
      })
    }
  }
}

Since setScheduler is never called, getScheduler obviously returns null. Similar failure occurs when attempting to use etch.observe.

The tests are passing because there's a TestScheduler wired up as part of the test harness setup.

Yeah, looks like an oversight. Now I instantiate the default scheduler if none is assigned when getScheduler is called. Let me know if there are any additional issues with this approach.