This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-15
Channels
- # admin-announcements (2)
- # beginners (93)
- # boot (34)
- # capetown (1)
- # cider (15)
- # cljs-dev (30)
- # cljsjs (9)
- # clojars (8)
- # clojure (199)
- # clojure-austin (3)
- # clojure-france (3)
- # clojure-greece (2)
- # clojure-italy (46)
- # clojure-quebec (7)
- # clojure-russia (2)
- # clojure-spec (76)
- # clojure-uk (16)
- # clojurescript (43)
- # core-async (7)
- # cursive (14)
- # data-science (1)
- # datascript (4)
- # datomic (3)
- # devcards (60)
- # editors (5)
- # funcool (5)
- # garden (3)
- # hoplon (32)
- # immutant (22)
- # jobs (1)
- # lein-figwheel (21)
- # leiningen (1)
- # mental-health (11)
- # mount (2)
- # off-topic (6)
- # om (16)
- # onyx (15)
- # re-frame (43)
- # reagent (20)
- # rum (18)
- # specter (37)
- # sql (2)
- # testing (8)
- # untangled (7)
- # yada (19)
Guys, can someone help… If I have a date parsed into unix, e.g.:
(:require [cljs-time.coerce :as time-coerce]
[cljs-time.format :as time-format])
(-> "2016-05-10" time-format/parse time-coerce/to-long)
@ag: show solution plz
(->> d-parsed time-coerce/from-long
(time-format/unparse-local-date (time-format/formatter "YYYY-MM-dd")))
I am now thinking if it’s worth of using cljs-time. clj-time for clojure is great, but I feel cljs-time is somewhat limited. Maybe I should just use moment
packaged in CLJSJS?
I posted this question on #C08H80CUR channel. But thought there’s more people here at the moment. Maybe you all can help me too >I’m playing with Rum’s Server-side rendering(https://github.com/tonsky/rum#server-side-rendering). What’s the approach for sharing data between server and client? >For example, I render a collection which queried from database on server-side. How do I get an access to manipulate this collection on client-side? Should I make a separate ajax call to retrieve similar data? Is there a better way to do this?
@tap: the server side rendering in Rum does not help you with transporting the data you rendered to the client. I guess one approach would be to serialize app-db and put it somewhere into your HTML
They had some interesting ideas about that a few years ago. They had the most complete isomorphic documentation for React when I was looking many years ago.
http://fluxible.io/ ah, this was their thing. And I'm pretty sure it was one of the early, if not the earliest, flux implementation with good isomorphic support.
@cdine yes, ClojureScript functions are just JS functions, you can pass these either way without issue
thanks @dnolen . I know that, but my q was about passing JS functions around to a cljs func.. for example a cljs func that can take js/document.getElementById
Or may be its a dumb q to ask...as its not just a func in the global scope but getElementById is a method of dom obj...
@cdine you may be asking a different question which is whether you can pass Object methods around as values and wether that will work
Makes sense... Cheers. I should try out stuff and may be comeback with specific questions..but thanks.
( def f #(js/document.getElementsByTagName %)) (defn f-app [fe a] (fe a)) (f-app f "body")
@cdine in general you have to be careful about passing methods, they need to bound so they don’t lose the context of the object they are a method of
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
@cdine this is one of the many cases where you cannot escape knowing something about JavaScript 🙂
what's the idiomatic cljs equivalent of clojure's inst?
predicate?
@christianromney: ClojureScript gained inst?
with the 1.9.76 release
so i went to https://github.com/cljsjs/packages/blob/master/d3/resources/cljsjs/d3/common/d3.ext.js and event is one of those without a function()