This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-23
Channels
- # announcements (2)
- # beginners (82)
- # calva (13)
- # cider (12)
- # clara (4)
- # cljdoc (22)
- # clojure (89)
- # clojure-dev (23)
- # clojure-europe (16)
- # clojure-italy (39)
- # clojure-nl (8)
- # clojure-spec (28)
- # clojure-uk (36)
- # clojurescript (40)
- # cursive (10)
- # data-science (1)
- # datomic (27)
- # devcards (4)
- # emacs (1)
- # fulcro (25)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (5)
- # luminus (1)
- # nrepl (68)
- # off-topic (64)
- # pedestal (23)
- # planck (1)
- # quil (4)
- # re-frame (6)
- # reitit (5)
- # remote-jobs (4)
- # shadow-cljs (16)
- # spacemacs (11)
- # testing (1)
@lilactown last time I asked itโs not really possible. Unless you manage to cleanly separate all the namespaces that require spec so that they are outside the main dependency graph. Which is hard in practice.
does anyone have any tips for dealing with timeout exceptions when working with core.async and external api calls? The timeouts basically crash the channels which eventually leads to an OOM death. The problem is that the timeouts only seem to occur in the prod environment and I'm having trouble figuring out which calls are timing out :/ Is there like a pattern for stabilizing the number of allowed concurrent promises, and for handling timeouts in promises?
@idiomancy turn the timeouts into values, put them on the result channel and process them
TIP:
Tools to explore bundle like this: https://www.npmjs.com/package/source-map-explorer also works in cljs
using :source-map true
to generate source maps then npx source-map-explorer main.js main.js.map
hello guys
how can i round numbers in clojurescript ?
(js/Math.round my-number)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
great, thanks guys
How would I call $(document).foundation()
within my CLJS code? I tried doing
(.-foundation js/document)
but that didn't seem to work.
.-
is for prop access
ah yes
I am running into issues and I dont know how to work around them. I have a div
that uses css/JS from Foundation. They say to add <script>$(document).foundation()</script>
at the bottom of your html file, after including Jquery and Foundation. After doing so the div is not behaving as expected. But if I go into the console and manually run $(document).foundation()
then the div works as expected. I thought maybe if I add that Jquery call in my ComponentDidMount function then it would work but that was not the case. Any idea on what I can do to get the JS properly working?
one thing could be that jQuery requires a method to be called with a proper context
@roman01la What do you mean by this?
ignore this, I thought compiler would emit code that calls a method without proper this
, but itโs ok
The workaround I did was (js/setTimeout #(.foundation (js/$ js/document)) 1000)
. This got it working. Did this call in a IDidMount
@mario.cordova.862 that looks very brittle. are you maybe loading the foundation stuff in the wrong order? ie. after the CLJS code?
@thheller I dont like the solution either but I couldn't figure it out. I believe I am loading in the correct order. Its before the CLJS code
It seems though I need to load the script after the CLJS code since thats what it looks like I am doing with the setTimeout
ok then the issue is probably that react will add an element to the page after foundation scanned the DOM for elements it should attach to
I believe so but even adding the 'reflow' to the foundation() call doesn't do anything.
Any time you are doing dom manipulation via libraries like jquery and using react you are going to have a lot of complications. I'd really recommend against doing that by either finding a library that has wrapped up the foundation functionality you want to make it react compatible, or by choosing a more react friendly library.