rachmanzz/vue-inview

High CPU usage in "Magic properties"

sainf opened this issue · 2 comments

sainf commented

First thanks for making the wrapper.

If we use like the readme the "Magic properties" it causes high CPU "sync".
Check in chromedev and find the culprit...

/**
  * (update → function)
    - life cycle update
**/
var updateLifeCycle = function (update) {
  var sync = function () {
    update()
    setTimeout(sync,0)
  }
  sync()
}

Perhaps increase the setTimeout?

Magic properties is not recommended to use, you can use the other choice like v-inview:on is same return.
updateLifeCycle is always run when _$inview called.

sainf commented

Ok, I'll remove the Magic properties from my code, thanks!