You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code we register a callback for an observer and don't keep a reference to the subscription ID:
importy_pyasYd=Y.YDoc()
defcallback(e):
print(e)
x=d.get_text("test")
defregister_cb(x, callback):
i=x.observe(callback)
# if i is not returned, the callback will never be called# return i # this works fine (callback called)i=register_cb(x, callback)
withd.begin_transaction() astxn:
x.insert(txn, 0, "abcd")
This can happen when we don't want to unobserve. But the issue is that in this case the callback is never called.
The text was updated successfully, but these errors were encountered:
In the following code we register a callback for an observer and don't keep a reference to the subscription ID:
This can happen when we don't want to unobserve. But the issue is that in this case the callback is never called.
The text was updated successfully, but these errors were encountered: