This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-11
Channels
- # aws (6)
- # beginners (105)
- # boot (6)
- # cider (50)
- # cljsrn (10)
- # clojure (41)
- # clojure-brasil (6)
- # clojure-italy (25)
- # clojure-nl (17)
- # clojure-russia (4)
- # clojure-serbia (1)
- # clojure-spec (8)
- # clojure-uk (242)
- # clojurescript (27)
- # core-async (10)
- # cursive (5)
- # data-science (9)
- # datomic (43)
- # emacs (6)
- # fulcro (6)
- # graphql (1)
- # javascript (3)
- # juxt (4)
- # lein-figwheel (1)
- # mount (1)
- # onyx (19)
- # parinfer (2)
- # portkey (15)
- # protorepl (1)
- # re-frame (30)
- # reagent (3)
- # ring-swagger (1)
- # shadow-cljs (22)
- # sql (6)
- # tools-deps (23)
- # vim (13)
Hi everyone! I'm looking at using these react components with an Om app. https://github.com/stripe/react-stripe-elements/blob/master/README.md Is this possible?
I have read this http://brentvatne.ca/js-react-components-in-om/ and this post makes good sense to me. It is the HOC aspect of the stripe ones that I am getting hung up on
Hi. Is there a low fuss way of doing await
in clojurescript without depending on core.async? Context is I want to treat an async api which uses promises as blocking.
@olivergeorge the promesa library has some macros that emulate await
. i have found that it isn’t perfectly general but it does work
you can also just use then
and catch
as they are normal methods. the promesa library helps with the ergonomics of that too
Thanks. I'll check promesa out.
(scratch that)
oh be sure to check out the alet
macro they have. i have found that when i really need await-like semantics, that’s good enough and it is more “clojureish”
Yeah, it's the blocking bit which complicates. Perhaps I'm asking for something silly.
i mean, keep in mind, await
does not really block. it just makes code that looks like it blocks. any function in javascript that uses await
returns a promise
Okay, perhaps it's not really what I'm after.
Gotcha.
Thanks.
(FYI I'm thinking about re-frame event handlers. There's no place for async data preparation before they run which makes async data sources inconvenient and incompatible as coeffects.)
try in #re-frame because they’ve definitely thought about how to do this in some proper way. i don’t use it myself because words like coeffects are scary 😛
🙂 will do. For what it's worth you learn to love them.
by the way, my random guess is that the answer will be: do it async and fire off another event when the result comes back
Yeah, I think you are right. I could wrap that up so it's a little less verbose too.
yeah, I use async storage as an effect, not a coeffect, and fire off an event when the result comes back
Question about resolving protocols in ClojureScript,
(defprotocol Testy
(testy-this [_]))
In Clojure I can get a list of the signatures:
(:sigs Testy)
{:testy-this {:name testy-this, :arglists ([_]), :doc nil}}
;; or in a macro
(:sigs @(resolve Testy))
In ClojureScript both of these give me nil, is there another way to get a list of the signatures of a Protocol in CLJS?@alexanderjamesking I don't think this is guaranteed to always work, but
(-> #'Testy meta :protocol-info :methods)
hey all I have I'm going through the om basic tutorial at https://github.com/omcljs/om/wiki/Basic-Tutorial . My om/root
looks like:
(om/root
(fn [data owner]
(om/component
(apply dom/ul #js {:className "animals"}
(map stripe (:list data) (cycle ["#ff0" "#fff"])))))
app-state
{:target (. js/document (getElementById "app0"))})
and when my app-state
(`data` in the om/root
scope) is:
(defonce app-state (atom {:text "Hello world!"}))
I get no warnings or errors even though the code should be mapping over the data
. Is this normal?more specifically: Why is this not an error?