This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-02
Channels
- # aws-lambda (1)
- # beginners (46)
- # boot (190)
- # cider (12)
- # clara (6)
- # cljs-dev (9)
- # cljsjs (8)
- # clojure (152)
- # clojure-austin (3)
- # clojure-berlin (3)
- # clojure-finland (2)
- # clojure-france (5)
- # clojure-italy (3)
- # clojure-russia (92)
- # clojure-serbia (4)
- # clojure-spec (7)
- # clojure-uk (190)
- # clojurescript (115)
- # cursive (20)
- # datomic (20)
- # dirac (4)
- # emacs (9)
- # gsoc (5)
- # hoplon (1)
- # jobs (1)
- # klipse (4)
- # lein-figwheel (1)
- # leiningen (6)
- # lumo (2)
- # mount (18)
- # off-topic (57)
- # om (68)
- # om-next (14)
- # onyx (33)
- # perun (32)
- # portland-or (4)
- # re-frame (21)
- # reagent (85)
- # ring (6)
- # ring-swagger (23)
- # schema (1)
- # uncomplicate (1)
- # untangled (13)
- # vim (7)
Hi all, I'm trying to update some things in my atom after I get a serversent message via sockets. My question is: what is the idiomatic way to merge in novelty?
I am using naive swap!s to adjust the atom state, but not every affected component is re-rendering... must I always use om/transact! ?
@sova there's om.next/merge!
which is probably what you're looking for
there's also an #om channel where more people can help you
@anmonteiro thank you
oh, I found this: http://muhuk.github.io/validation-benchmark/
so the next question, is there any lib to transform schema specs into spec or truss?
@ashnur if you just want to log cljs objects and be able to inspect them in the console https://github.com/binaryage/cljs-devtools is the way to go
thanks, will look those up 🙂 i bet half of them does the same thing with minor differences?
the devtools stuff just teaches chrome about cljs objects so they can be inspected like normal js objects
it's useful to call console.log directly because chrome knows the location of your log message in the code then
if i have a range of numbers, what's the fastest way (i actually care more about the performance this time than anything else), to do a cartesian product with itself but each element from the resulting list of pairs is only kept based on a probability function. normally i would create the whole list and remove elements from it, but because of performance, I should probably do it the other way around?
i definitely will not do that. i would rather never ever touch either clojure or clojurescript than to have to go there ever again.
and frankly, the biggest mistake was to base clojure on jvm, that i will never understand
guess there were not many options, and all the others would've been harder or would've brought less fame/money
for multidimensional data i would definitely use this in javascript https://www.npmjs.com/package/ndarray
but this is more like just being able to do fast loops and read/write data, mutate stuff, not multidimensionality
"CLJS DevTools internal error: TypeError: pred.call is not a function" (i know that most of the errors I encounter are because I don't yet know what I am doing, but the error messages do not help much either to find it out :)) )
now can I use the ndarray modules with this? 🙂 https://github.com/scijs/ndarray/wiki/ndarray-module-list
@ashnur if I had to guess it is probably trying to log something lazy causing the error to appear "devtools internal" vs in your code
i figured it out since, i put the docstring in the predicate in the wrong place, you can't call a string as a function
What’s a good way to include npm dependencies in a project? Say I’m using lein, would I use npm to save the deps and then load them using lein? How to other developers approach this?
There is this https://github.com/RyanMcG/lein-npm which seems to exactly what I want.
Just wondering if there is a standard or idiomatic way to manage npm deps.
@stuartrexking there was a lot of new stuff in the recently release 1.9.456
, lots of changes coming with regards to npm
Yeah, but none of it around dependency management.
It’s all great for loading the libs once you have them, but how do you manage fetching the deps etc.
@thheller thanks.
@ashnur internal CLJS DevTools errors are usually caused by exceptions raised during printing of your data structure, e.g. buggy implementation of some protocols used during printing or bad data shape. You should see full stack trace when you expand the internal error log message. That would be more helpful to reason about your issue.
Hi, when using reagent project template, I use lein fighwheel. However, if I change something in server side, I need to C-c and lein fighwheel again to see the changes. What is a better/appropiate way to do this?
@tomaas: @bhauman, the creator of Figwheel had a cool answer to this 🙂 https://www.youtube.com/watch?v=j-kj2qwJa_E&feature=youtu.be&t=38m
You could try to adopt the reloaded workflow[1], but that would require you to write reloadable code and use reloadable libraries [1] http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
@tomaas you can also use Component to configure your Web Server + Socket REPL Server Clojure & ClojureScript (Figwheel)
what's the suggested way to do this in cljs? https://gist.github.com/ashnur/a99a08ea787cb0147669803b31bb9da5
i have (.forceSimulation js/d3)
working so far, but I am guessing the chain stuff would look bad if I tried
@sveri belated thanks for that stuff about Om & Reagent earlier, got called away from the keyboard. I’ve used Rum in combination with statecharts and a hodgepodge of individual libraries so I’m keen to see how a more integrated app foundation could work, & it seems that comes down to a choice between reframe and Om.Next
Is there an up to date tutorial for using the new npm module resolution with figwheel and friends?
has anybody ever made externs for Object.defineProperties
, how does this look like?
var IntersectionParams = {
"TYPE": {
"LINE" : {},
"RECT" : {},
"ROUNDRECT" : {},
"CIRCLE" : {},
"ELLIPSE" : {},
"POLYGON" : {},
"POLYLINE" : {},
"PATH" : {},
"ARC" : {},
"BEZIER2" : {},
"BEZIER3" : {}
}};
@richiardiandrea I don’t understand how is that related to Object.defineProperties
?
uhm, maybe I am doing it wrong, I am writing externs for: https://github.com/thelonious/kld-intersections/blob/development/lib/IntersectionParams.js#L50
@richiardiandrea I’m pretty sure that using Object literals like that won’t work
@dnolen yeah I tried to have a look there, fuzzy results, but I'll search more
oh well, we are practical right? 🙂
basically I need to be sure that TYPE.LINE
works fine...it looks like your solution is good, will report back
Awesome thanks @dnolen