This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-31
Channels
- # admin-announcements (9)
- # announcements (2)
- # beginners (16)
- # boot (18)
- # cider (22)
- # cljs-dev (10)
- # clojure (154)
- # clojure-denmark (5)
- # clojure-dev (5)
- # clojure-nl (2)
- # clojure-russia (13)
- # clojurescript (161)
- # cursive (3)
- # datomic (9)
- # editors (5)
- # emacs (25)
- # hoplon (57)
- # immutant (19)
- # instaparse (1)
- # ldnclj (2)
- # liberator (19)
- # off-topic (7)
- # re-frame (12)
- # reagent (10)
Just a heads up, added +garden profile to re-frame-template https://github.com/Day8/re-frame-template/
Hello. Have anybody ever had a problem like this: you call (println foo)
and get #<Reaction 20: nil>
, then (right after) call (println @foo)
and get No protocol method IDeref.-deref defined for type string: 518ecf36-6890-4a99-b48b-c6cc3de41a83
?
Could you please correct me if i'm wrong. Generally we need dynamic subs only if we don't want to remount component with another arguments?
@nidu: maybe this could help? https://github.com/Day8/re-frame/pull/108
@darwin thanks. Yeah, that's what i'm using right now. However i don't fully understand if we can achieve the same effect with simple subs. My guess is that when you remount component with simple sub - you simulate dynamic sub. I'm pretty sure it's not that easy but a bit confused at the moment. Probably just lost looking for a cause of the above issue.
@nidu: yes, I would think that remounting component with a different static subscription should work
remounting could be also causing parent component to render, effectively creating a child component from scratch
@nidu:
Regarding #108, dynamic subscription use will look like this:
(subscribe [:todo-dynamic x y z] [a b c])
Where:
x y z must be values
a b c must be ratoms or reactions (values which change over time)
You are creating a signal which has input signals a b c (plus app-db
).
And, yes, you can simulate a dynamic subscription by either: 1. destroying and recreating a Form2 component which has a static subscription 2. (as explained previously) storing the "dynamic values" within (a b c) within app-db itself which means app-db is the only input signal you need.
Regarding point 1 above .... see the first item in here: https://github.com/Day8/re-frame/wiki/More-advanced-Reagent-techniques