This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-13
Channels
- # aleph (7)
- # announcements (3)
- # babashka (29)
- # beginners (70)
- # calva (5)
- # cider (14)
- # clara (3)
- # clj-kondo (25)
- # cljs-dev (2)
- # clojure (237)
- # clojure-conj (3)
- # clojure-europe (6)
- # clojure-italy (14)
- # clojure-nl (4)
- # clojure-uk (40)
- # clojurescript (29)
- # clojurex (1)
- # code-reviews (2)
- # cursive (3)
- # datascript (1)
- # fulcro (11)
- # graalvm (4)
- # graphql (12)
- # jackdaw (1)
- # jobs (1)
- # joker (22)
- # london-clojurians (1)
- # off-topic (132)
- # re-frame (38)
- # rewrite-clj (11)
- # shadow-cljs (200)
- # spacemacs (1)
- # sql (67)
- # tools-deps (15)
I've just found charAt
, that might work as a substitute, but I'm still curious if it's possible to do this?
Can someone explain how to get a REPL to develop https://github.com/JulianBirch/cljs-ajax ?
Can you be more precise? Do you want to use cljs-ajax in a REPL, or use a REPL to contribute to the package?
I want to use a REPL to contribute. I only managed to do so by creating a blank Shadow CLJS project and copying in the source tree
Hi. I have a question about global-exports.
The example at https://clojurescript.org/news/2017-07-30-global-exports uses a library which has a default export (React). But my library exports multiple named exports (`MarkerMap`, RouteMap
, SetCoordinateMap
and SetMultipleCoordinatesMap
and no default export).
My sollution so far:
{:file "resources/lib/kartklient.js"
:provides ["markerMap" "routeMap" "setCoordinateMap" "setMultipleCoordinatesMap"]
:global-exports '{markerMap MarkerMap
routeMap RouteMap
setCoordinateMap SetCoordinateMap
setMultipleCoordinatesMap SetMultipleCoordinatesMap}}
then I can use it like this:
(ns dhp-client.helpers.kartklient
(:require [reagent.core :refer [adapt-react-class]]
[markerMap :as markerMap]
[routeMap :as routeMap]
[setCoordinateMap :as setCoordinateMap]
[setMultipleCoordinatesMap :as setMultipleCoordinatesMap]))
(def marker-map (adapt-react-class markerMap))
(def route-map (adapt-react-class routeMap))
(def set-coordinate-map (adapt-react-class setCoordinateMap))
(def set-multiple-coordinates-map (adapt-react-class setMultipleCoordinatesMap))
Is there a way I can group markerMap, routeMap etc under a namespace, e.g. kartklient
so that I can say [kartklient :refer [markerMap routeMap setCoordinateMap setMultipleCoordinatesMap]]
instead of having markerMap
, routeMap
etc as top level namespaces?Hello, i’ve got a warning when I evaluate this form: (cljs.core/MapEntry. 1 2)
------ WARNING - :fn-arity -----------------------------------------------------
Resource: :1:1
Wrong number of args (2) passed to cljs.core/MapEntry
--------------------------------------------------------------------------------
It seems to work as intended, but I’m curious about the warning
I’m using clojurescript 1.10.520@pbaille why are you constructing it directy? it takes a third hash argument, you can pass nil
I like to use map-entries to represent linked things, not always in the context of a map
does anyone know if I can include a plain javascript file as part of a clojurescript (`*.cljc`) release to clojars ? I am not entirely sure of how this would play on the consumer side … would they have to have the same configuration as my local one for it to work ? will it work at all ? :thinking_face:
@carocad You can include a deps.cljs
file in a JAR which points to a JavaScript file (as a foreign lib)
Quick question -- when we initialize-db
, how and from where does the map get populated from?
this is the event initialize-db command i have. wondering how it fills in the data. I guess I am wondering what happens behind this code?
I’m guessing you’re talking about using re-frame. There’s no magic; if you want to initialize the DB, you can create an event (like you have there) and have it return the map of initial data
it looks like that code there assumes there’s some db
namespace that has a default-db
var in it which has the map of initial data
and then somewhere else in the code, when it renders the application it must call (dispatch-sync [::initialize-db])
awesome, thanks for the quick reply! so ultimately it's the dispatch that populates the db map?
gotcha.. i am still trying to wrap my head around the initializing