This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-14
Channels
- # admin-announcements (2)
- # beginners (32)
- # boot (217)
- # cider (20)
- # cljsjs (25)
- # cljsrn (9)
- # clojure (87)
- # clojure-android (7)
- # clojure-austin (4)
- # clojure-belgium (10)
- # clojure-canada (13)
- # clojure-dev (28)
- # clojure-dusseldorf (2)
- # clojure-greece (119)
- # clojure-nl (1)
- # clojure-russia (22)
- # clojure-spain (3)
- # clojure-spec (81)
- # clojure-uk (54)
- # clojurescript (32)
- # community-development (2)
- # core-async (19)
- # cursive (18)
- # datascript (5)
- # datomic (1)
- # dirac (22)
- # emacs (22)
- # hoplon (198)
- # incanter (1)
- # instaparse (4)
- # jobs (3)
- # keechma (15)
- # ldnclj (2)
- # lein-figwheel (14)
- # mount (8)
- # om (78)
- # om-next (4)
- # onyx (37)
- # other-languages (1)
- # pedestal (6)
- # re-frame (22)
- # reagent (25)
- # ring-swagger (17)
- # robots (1)
- # slack-help (1)
- # spacemacs (7)
- # specter (50)
- # spirituality-ethics (3)
- # uncomplicate (5)
- # untangled (1)
- # yada (17)
guys, how do you look through a collection of reactions in a render block?
this throws me an Uncaught Error: [object Object] is not ISeqable
:
(let [mailboxes (subscribe [:mailboxes])])
...
(for [mailbox mailboxes]
^{:key (:account mailbox)} [mailbox-row mailbox])
in the db, mailboxes is a vector
(let [mailboxes (subscribe [:mailboxes])])
...
(for [mailbox @mailboxes] ;;<- notice @
^{:key (:account mailbox)} [mailbox-row mailbox])
ah, what a rookie mistake. what is the @
for?
ah, many thanks!
for that i dont need luck but wisdom from guys like you 😉
Is there a way to have a “if not found in the database, do a remote fetch” pattern in subscription. Is it even a valid pattern in re-frame ?
Wonderful! Thanks @mccraigmccraig
@jarcane: Yes, by updating state atom from onhashchange and creating reaction from that
@tom, that's explained in https://www.martinklepsch.org/posts/props-children-and-component-lifecycle-in-reagent.html -- and yes, it's not exactly straightforward with reagent
Hey guys, a quick question. I'm exporting a reagent component to be used in a React project. Is it possible to re-render on receive new props from React component?
I've been in the world of re-frame (it's really good) for a while so I'm fuzzy on plain reagent. You should be able to mutate the ratom inside a lifecycle method like component-will-receive-props
.
Another thing is that say I pass in props as <MyComponent props={this.state.props1} />
where MyComponent
is the exported reagent component. Does it need to be defined as (defn my-component [props] ...)
or just (defn my-component [] ...)
and then get props through (r/props r/current-component)