-
Notifications
You must be signed in to change notification settings - Fork 27
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
Possible bug: watches are dropped #33
Comments
Are you using |
Latest snapshot is up on Clojars. Dropped in your code quickly and didn't notice anything unusual - maybe you can check it out. Thank you for submitting a full example. |
Btw, you need to change your last rx to: (rx [:div
[:p "full-state is:" (str @complex-state)]
[:p "num watches on full state: " (str (.-watchers complex-state))]
[:p "num watches on time update cursor: " (str (.-watchers time-cursor))]]) |
That has resolved the issue. I do get compile errors with the snapshot though. WARNING: Use of undeclared Var freactive.core/this at line 383 ... freactive-0.2.0-SNAPSHOT.jar!/freactive/core.cljs I did notice that the number of watches varies - this could be due to when they are being re-rendered. The update cursor is generally 1 but goes from 1 to 0 and back (this seems reasonable). the full state is generally 4 but jumps up and sown to to 5 when moving the mouse - that looked a little suspicious. But there may be a good reason. I checked the repeated call of mount and that was also resolved. When do you plan a 0.2.0 release? Thanks |
Yep, there's still some cleanup to do. Watches are added and removed dynamically to prevent spurious change notifications so it's expected they will go up and down - what we don't want to see is them going up out of control or disappearing unexpectedly. Hoping to resolve #22 and #8 before 0.2.0 is released - hopefully soon, but depends on when I get free time. |
I have been investigating freactive and came across the following - which appears to be a bug.
I was testing out cursors and compound state access in rx.
I created a "complex-state" that included a mouse position and time.
mouse position is updated on mouse move
time is updated by a setInterval.
The bug appears to be that the watch on the time state or cursor is lost when the mouse is moved. i.e the reactions on time-cursor work but then stop when the mouse is moved.
Another thing that I noticed was that repeatedly calling (rdom/mount! root (view)) will keep adding watches. Many more that would seem necessary if mount is replacing the view.
Are these errors on my part - or is there an issue here?
Code below:
The text was updated successfully, but these errors were encountered: