This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-23
Channels
- # babashka (22)
- # beginners (8)
- # calva (7)
- # clj-kondo (65)
- # cljdoc (9)
- # cljsrn (1)
- # clojure (53)
- # clojure-australia (4)
- # clojure-europe (49)
- # clojure-gamedev (2)
- # clojure-italy (13)
- # clojure-nl (1)
- # clojure-spec (19)
- # clojure-uk (4)
- # clojurescript (48)
- # clojureverse-ops (1)
- # core-async (3)
- # css (2)
- # cursive (15)
- # datomic (6)
- # degree9 (2)
- # depstar (4)
- # emacs (2)
- # find-my-lib (1)
- # fulcro (16)
- # graalvm (11)
- # gratitude (1)
- # honeysql (9)
- # introduce-yourself (2)
- # jobs (1)
- # joker (2)
- # livestream (2)
- # malli (16)
- # nbb (4)
- # news-and-articles (2)
- # off-topic (1)
- # pathom (7)
- # polylith (10)
- # practicalli (1)
- # re-frame (7)
- # reitit (1)
- # releases (3)
- # remote-jobs (1)
- # rewrite-clj (19)
- # shadow-cljs (10)
- # tools-build (1)
- # tools-deps (9)
- # uncomplicate (1)
- # vim (3)
- # xtdb (44)
Need more details because that's exactly what I see on my end in a NodeJS-based REPL:
cljs.user=> (get {26 {:a 1}} 26)
{:a 1}
So, the needed details:
• Platform
• CLJS version
• A confirmation that that get
is indeed cljs.core/get
and not some other function
• A minimal reproducible example, ideally
You can also just find that code in the compiled JS and see what's going on exactly, without having to guess.
the function returns a map that looks like {26 … etc}. I put it in an atom and check for (get @restult 26) and it returns nil
Do you deref and print it right there along with get
or do you do that some time later? If so, it might be some hard to debug timing issue.
Sounds like there are many more moving parts than a plain text explanation would cover. Please create an MRE.
Still no idea what you mean, given that
cljs.user=> (get (sorted-map 26 {:a 1}) 26)
{:a 1}
But if you got it resolved, then great.I'm 80% certain you're doing something strange and that's not a problem with CLJS. :)
But damn how confusing it is when the repl-output has the appearance of a map or whatever, when it is not
Do any of you have a (obviously very subjective) favourite library for wrapping promises?
I know about core.async's rather spectacular <p!
https://clojurescript.org/guides/promise-interop#using-promises-with-core-async - wondering what else might be out there.
Here promesa author, we are using it extensively in relatively big projects like penpot among others. If you have any issue, feel free to ask.
I have a question, does something similar to codepen for javascript/react exist for clojurescript/react. I.e. in codepen, I can (as described in the react tutorial) code the html, css, and javasript for a small app and see the changes and console live in the right hand window. Useful for a purely "in the browser" programming experience and getting to try a toolset quickly without installs etc.
what’s the best way to make ipfs requests from clojurescript?
cljs-http returns cors error for my ipfs endpoint
no it’s public ipfs
If I remember CORS correctly, it sounds like they don't want you to use it for your own website. At least, not from a browser, since it doesn't specify the right headers to allow your browser to access it.
And looks like IPFS itself might have something to do with it: https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway