Skip to content

Instantly share code, notes, and snippets.

@arvitaly
Created September 7, 2016 19:20
Show Gist options
  • Save arvitaly/b3335f415d14c0bdcb9fa036035ad424 to your computer and use it in GitHub Desktop.
Save arvitaly/b3335f415d14c0bdcb9fa036035ad424 to your computer and use it in GitHub Desktop.
Не происходит асинхронная подписка на ячейку cellx?
var cellx = require('cellx');
var a = cellx(55);
var x = cellx((push) => {
//a() //Если раскомментировать эту строку, то x начинает пересчитываться!
setTimeout(() => {
push("test" + a());
}, 100)
})
x('addChangeListener', () => {
console.log("addChangeListener, x:: ", x());
})
console.log("starting value of x:: ", x());
setTimeout(() => {
console.log("Change a");
a(66);
setTimeout(() => {
console.log("After `a` change, x:: ", x())
}, 200)
}, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment