Replies: 9 comments
-
If you are doing It sounds like you want to chain reactions, so a I often have subscriptions like: (register-sub
:page-1/cursor
(fn [db]
(reaction (-> db deref :my :nested :path)))
(register-sub
:page-1/interesting-stream
(fn [_]
(let [state (subscribe [:page-1/cursor])]
(reaction (some-expensive-process @state)))) If I want to do any searching then I might have an intermediary The code to calculate the subscription for Maybe you could post some sample code... (Mike - not sure of the etiquette of community answering github issues or the use of github issues as a support tool so apologies if I have overstepped ;-)) |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for your fast response. I my case i want to avoid re-rendering the whole collection when an Item changes. Thats why i have a component that does create the list and each item is a seperate component. The List Item subscribes only to a reaction of the keys, so it should not need to update if an item changes. But it does.
Everytime i click on the href all entries re-mount and the list updates. The hack with that i have come up is to wrap a reaction around the seriealisation of the keys and deserialize them in the for loop like this:
With this only the entry that changes updates. Do I miss somthing? |
Beta Was this translation helpful? Give feedback.
-
I haven't looked too deeply but I noticed this in your code immediately above... Each time Replace with: I'd rewrite:
|
Beta Was this translation helpful? Give feedback.
-
Also, a reminder: this place is for reporting bugs and requesting features. Please take this up in the various help forums like:
|
Beta Was this translation helpful? Give feedback.
-
Ok, your suggestion works. But still, is it not a bug that this reaction |
Beta Was this translation helpful? Give feedback.
-
http://clojurians.net/ is broken. |
Beta Was this translation helpful? Give feedback.
-
@hkjels Must have been a temporary issue. Seems to be working now. |
Beta Was this translation helpful? Give feedback.
-
Nope. Same result. It happens when I press the "GET MY INVITE"-button. |
Beta Was this translation helpful? Give feedback.
-
That's odd. I looked across in #general, where people start, and I can see that 5 people have joined in the last 6 hours. So it seems to be working for others. Anyways, perhaps you could use: https://groups.google.com/forum/#!forum/clojurescript |
Beta Was this translation helpful? Give feedback.
-
Hi,
let's say my app db is a nested dict where the root-keys are string ids.
(e.g {"1" {:a "a" :b "b"} ...}
When i put a reaction on a collection of the keys ( I tried lazy-seq,list,array,set)
that reaction is triggered when I do updates on the values.
I expected it not to, because the value of the collection has not changed.
Are you aware of this and is this expected behavior?
Otherwise i'm happy ton come up with a complete example.
(For now i serialize the collection of keys into edn, put a reaction on that and after the deref i do read-string. This is obviously horrible, but works as expected!)
Beta Was this translation helpful? Give feedback.
All reactions