-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] setting an empty object does not trigger any event handlers? #1319
Comments
Ah, I got s.th.:
sometimes writes onto the console, sometimes it doesn't (that's why I currently use this approach in my experiments in order to avoid the event handler being called initially, i.e., after loading previous contents from localStorage - which works most of the time...) are these "race conditions"? Sorry for bothering you! |
I'm completely lost... what I did:
the last step shows that the previous contents (namely How can that be? I am not yet using any relay - everything works locally only (albeit with "localStorage" in the background, if I understood the concepts correctly) |
if you overwrite something with a primitive, then re-save an object to it... it'll re-generate the same deterministic soul on that path, thus it'll "re-find" the old data.
|
Thank you very much for your explanation. However, I somewhere found the "recipe" to first nullify an object and then to write a new one using the same context (I have to find where, but I'm really lost in the jungle of overlapping doc sections and wiki pages...). This recipe would contradict your explanation then. |
Hello!
I'm currently trying to learn how to use Gun - please forgive me if my question turns out to be nonsense (or has been documented somewhere, but I missed that)
I know that setting a shared object triggers an event handler
This works for
null
, booleans, numbers, strings and (non-empty) objects.However, if I set an empty object, the event handler is not triggered
Is this intended?
sharedData
seems to have been changed successfully, but I can't even retrieve this value usingwhich is strange since an empty object is still an object - and setting s.th. to
null
does very well trigger an event handler...The text was updated successfully, but these errors were encountered: