This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-03
Channels
- # beginners (446)
- # boot (16)
- # cljs-dev (2)
- # cljsrn (30)
- # clojars (2)
- # clojure (143)
- # clojure-finland (1)
- # clojure-greece (1)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (20)
- # clojure-uk (7)
- # clojurescript (167)
- # code-reviews (1)
- # community-development (12)
- # core-async (27)
- # cursive (3)
- # data-science (9)
- # datascript (2)
- # emacs (1)
- # graphql (46)
- # immutant (5)
- # jobs (2)
- # leiningen (1)
- # luminus (1)
- # lumo (76)
- # off-topic (79)
- # perun (2)
- # protorepl (33)
- # re-frame (21)
- # reagent (62)
- # ring-swagger (1)
- # rum (18)
- # spacemacs (6)
- # specter (4)
- # test-check (4)
- # unrepl (9)
- # untangled (2)
- # vim (4)
- # yada (1)
So I have an issue. NEVERMIND. The load/process pattern confused me and I called the process and not the load.
(reg-event-db
:process-notes-list
(fn [db [_ response]]
(-> db
(assoc :notes-list-answered? true)
(assoc :notes-list response))))
(reg-event-db
:load-notes-list
(fn [db _]
(GET "/api/list-notes" {:format :json
:handler #(dispatch [:process-notes-list %])})
db))
Then later, after dispatching :process-notes-list, notes-list
is nil
. I have similar code doing the same thing with another API endpoint and it’s working fine, and the API works fine in swagger… Any tips?Hello all, if I want to control the enable state of a button, where do I use it, :component-did-mount
or :component-did-update
?
@fabrao neither!
[:button {:disabled @enabled?}]
the problem is that the button state set is inside jQuery object like this
(if (not= "" @(re-frame/subscribe [:item-selecionado]))
(.enable (aget js/w2ui (str nome "_toolbar")) "print")
(.disable (aget js/w2ui (str nome "_toolbar")) "print"))
you're not making things easy for yourself my using react with a third-party (non-react aware) UI toolkit
no no, you can do it, but it requires a certain amount of trickery
you'll need to create the external button in the component-did-mount fn (or callback ref)
essentially you want to build a wrapper component
which takes enabled? as a prop
then add a component-will-receive-props method to react to changes to the prop by calling the imperative code
but if you need to do it a lot, you won't enjoy have a pleasant time
better to pick a react-ready (or css-only) toolkit