This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-21
Channels
- # admin-announcements (17)
- # aws (19)
- # beginners (28)
- # boot (103)
- # cider (5)
- # clojure (183)
- # clojure-art (46)
- # clojure-russia (25)
- # clojure-sg (2)
- # clojure-uk (1)
- # clojurescript (342)
- # clojurex (3)
- # core-matrix (1)
- # cursive (1)
- # datascript (2)
- # devcards (77)
- # devops (15)
- # emacs (4)
- # funcool (8)
- # hoplon (15)
- # immutant (47)
- # jobs (1)
- # ldnclj (10)
- # lein-figwheel (4)
- # off-topic (2)
- # om (23)
- # onyx (10)
- # re-frame (1)
- # reagent (23)
- # yada (7)
(:require [mp.endpoint.property :refer [endpoints]])
cool, but how do I refer to endpoints as property-endpoints ( :refer :as doesn't seem to work as I hoped )
This looks to be what I was looking for [mp.endpoint.property :refer [endpoints] :rename {endpoints property-endpoints}]
yes that's closer to what you want although fyi it's unusual to use :rename - more common to alias the ns and use the aliased form
(:require [mp.endpoint.property :as property]) and then use property/endpoints in the code
@alexmiller: Ok thanks, I'll do that.
at the point of use in the code, you then have breadcrumbs that lead you back to the ns alias in the require and to the (same) named function in the external ns
How do I export a cljs function so that normal JS can call it from the global namespace? E.g. Google Maps JavaScript API has a callback argument that is a global function name. I tried (defn ^:export initMap [] ...)
and (aset js/window "initMap" initMap)
, but the fn does not seem to show up in window.initMap
.
Apologies - it does work. Needed a hard refresh .
I want to pretty print a cljs #js data structure, but (prn (js->clj some-form))
outputs an "unreadable form", which cannot be read by read-string
. Is this expected? It seems to be object representations like these "viewport" #<((-33.9284489802915, 18.41180101970849), (-33.9257510197085, 18.414498980291455))>}
.
How can I format this to get any edn pretty printer to parse it?
Or at least, I want to strip out these forms and look at the readable forms in the data structure.
Posted SO question: http://stackoverflow.com/questions/32693793/pretty-printing-an-unreadable-clojurescript-js-form
Thanks. I got the export working.
I don't need a round-trip, just to get rid of the unreadable forms.
Is there a fn that can test if a value is a #js object so that I can filter it out?
Any way to define a fallback print-dup fn for any type without it?
OK. In my case, it's just a really large nested map of returned Google Places and I could easily find the path I'm looking for if I could just pretty print it.
I'll try a regex
I work at a Python shop but I am am learning Clojure on the side and would like to pursue Clojure opportunities. What are the best ways to pursue Clojure job opportunities without having Clojure work experience?
@kyle_schmidt: working on open source projects is one way of getting experience working on real world projects, but that's unlikely to be paid.