-
Notifications
You must be signed in to change notification settings - Fork 21
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
Bug in aggregate subscriptions based on rum derived atoms ? #13
Comments
As a temporary workaround I'll do the following. What do you think ? (let [rec (scrum/reconciler {:state (atom {})
:resolvers {[:a] (constantly :a)
[:b] (constantly :b)}})
sub-a (fn [reconciler]
(scrum/subscription reconciler [:a]))
sub-b (fn [reconciler]
(scrum/subscription reconciler [:b]))
derived (fn [reconciler]
(let [a @(sub-a reconciler)
b @(sub-b reconciler)]
[a b]))]
(derived rec)) The example is dumb, but I hope you get the point. |
FYI, not working, since I'm using it as a subscription (with |
Hey. You are right. I'm going to update the code later today. Which version of Scrum is it? |
Going to upgrade to 2.2.0 to ease the transition to the bugfix version. |
No worries, I'll update both. |
Actually I think that's inconsistency in Rum. When used in Clojure derived-atom shouldn't add watchers. |
Indeed, I think you're right : you render in one pass server-side, watches are useless. At least so it seems. Are you opening an issue in Rum ? |
Yeah. Going to talk to Nikita about this. |
Fixed in 86d9adf for 2.1.0 and 2.2.9 in master. Please check if it works for you. |
Looks like it works fine in 2.1.0. Thanks a lot ! |
Hi,
I'm following the README to the letter and I think I found a bug. See the following minimal reproduction case in the REPL :
Whereas plain derived-atoms in rum work fine :
The problem : rum calls
add-watch
on each ref, and in clojure.coreadd-watch
has a type hint on the ref ofclojure.lang.IRef
.(I think) I was able to track down the root cause : scrum's Resolver only implements
clojure.lang.IDeref
protocol, butclojure.lang.IRef
extends IDeref and implements more methods. I think the Resolver should implement IRef as well to work just fine. Not sure, I'm not very familiar with Clojure's protocols.In the meantime, not sure what I should do to work around the problem.
The text was updated successfully, but these errors were encountered: