This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-15
Channels
- # aws (25)
- # babashka (11)
- # beginners (24)
- # calva (18)
- # clj-kondo (6)
- # cljdoc (1)
- # clojure (48)
- # clojure-europe (3)
- # clojure-houston (1)
- # clojure-uk (22)
- # clojuredesign-podcast (8)
- # clojurescript (9)
- # cursive (8)
- # dirac (6)
- # duct (19)
- # fulcro (17)
- # hoplon (29)
- # mount (3)
- # off-topic (24)
- # pathom (6)
- # re-frame (6)
- # shadow-cljs (5)
- # spacemacs (5)
- # sql (10)
- # tools-deps (7)
- # vim (2)
Hi, I am trying to insert react component (https://www.npmjs.com/package/react-div-100vh) into reagent app. I follow instructions found here https://github.com/reagent-project/reagent/blob/master/doc/InteropWithReact.md#creating-reagent-components-from-react-components The problem is (reagent/adapt-react-class div100vh/Div100vh)
throws an exception - Error: Assert failed: Component must not be nil
I am pretty new to integration React to ClojureScript and not sure how to approach this. If anyone have any hints – this would be greatly appreciated.
@aleksandr.furmanov if you’re using shadow-cljs, try ["react-div-100vh" :default Div100vh]
Awesome, it works! Thanks @lilactown!
@aleksandr.furmanov You can find useful JS import in the Shadow-CLJS official docs : https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
Im running promesa (https://github.com/funcool/promesa) on nodejs, but i can't seem to deref the promises. Has anyone ran into similar issues? not really sure what to use for heavy interop with promises i clojurescript 🙂 might just go native js.
People mention https://github.com/athos/kitchen-async
Native promises work quite nicely with thread first macro.
(-> (js/Promise.resolve "blaa")
(.then (partial str "blöö"))
(.then println))
And yes AFAIK deref
works only with JVM Promesa because you can’t really block. You need to use alet
macro or something similar. I’ve been happy with native js promises though.
Hello guys! I am trying to use socketcluster which was written in nodejs: https://github.com/SocketCluster/socketcluster/blob/master/app/server.js. I tought I should write this in clojurescript. I got stuck at this one:
(async () => {
for await (let requestData of httpServer.listener('request')) {
expressApp.apply(null, requestData);
}
})();
How can I implement this? for example in core.async. Any help is appreciated 😄