This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-14
Channels
- # aleph (16)
- # bangalore-clj (4)
- # beginners (19)
- # boot (27)
- # cider (81)
- # clara (2)
- # cljs-dev (343)
- # cljsrn (97)
- # clojure (224)
- # clojure-hk (1)
- # clojure-italy (25)
- # clojure-russia (5)
- # clojure-serbia (2)
- # clojure-spec (7)
- # clojure-uk (27)
- # clojurescript (97)
- # cursive (8)
- # datomic (48)
- # docker (1)
- # emacs (15)
- # hoplon (39)
- # jobs (4)
- # lumo (13)
- # off-topic (2)
- # om (66)
- # onyx (7)
- # parinfer (5)
- # pedestal (2)
- # play-clj (10)
- # protorepl (2)
- # quil (1)
- # re-frame (38)
- # reagent (33)
- # spacemacs (1)
- # specter (4)
- # sql (19)
- # test-check (31)
- # unrepl (4)
- # untangled (3)
What are the options of state management for reagent?
I know re-frame, keechma, petrol, "simply use swap, what else do you need?" and "roll your own"
Any others?
I guess you could use re-frame only for processing actions, ignoring the subscriptions?
added to the gist
@pesterhazy I also update this list from time to time, but not every lib is strictly about Reagent: https://metametadata.github.io/carry/faq/#what-are-the-alternative-clojurescript-frameworks
cool - you're right, state management doesn't have to be about reagent at all
is there a way to get the HTML string from a react component? (fn bootstra-popover-content [] (fn [content] [:div content]))
=> <div...
@joshkh https://facebook.github.io/react/docs/react-dom-server.html#rendertostaticmarkup ?
fyi, it looks like reagent wraps react dom server: https://github.com/reagent-project/reagent/blob/master/src/reagent/dom/server.cljs
@pesterhazy https://github.com/mpdairy/posh, we’re using it with https://github.com/denistakeda/re-posh
Hi all, I’m getting an error Error: Assert failed: Invalid tag: 'F#' (in tabber.core.Chords)
when trying to perform (map #(str/split % #"/") song)
on ... F#/m7/4 ...
. It is a music app so I need to be able to use #
but any chord that uses it throws an error. Any way to escape that? Never had this error in React or any other language so not sure how to proceed. thx!
Here is the trace if that helps
(defn parse-tag [hiccup-tag]
(let [[tag id class] (->> hiccup-tag name (re-matches re-tag) next)
class (when-not (nil? class)
(string/replace class #"\." " "))]
(assert tag (str "Invalid tag: '" hiccup-tag "'"
(comp/comp-name)))
#js{:name tag
:id id
:className class}))
you're usiing F#
as a component - that seems wrong
@pesterhazy hmmm. I’m just converting a long string of a/b/c a/b/c a/b/c
to a list of ( ["a" "b" "c"] ["a" "b" "c"] ...)
that is then being fed into a component but as for using F#
as a component…. it is used the same as all other characters without a trailing #
and those have no error. Seems to be how the #
is being interpreted.
the first element of a vector is treated as a component or tag
perhaps you want to start off the vector with something like :span
before the note strings
@noisesmith Oh I see… Sorry @pesterhazy didn’t catch that meaning. But why do I have no problem with all the other notes with no #? I can’t really add a span in front of these because I’m using them as strings. I can rework my solution but I’d like to udnerstand why I’m having the issue since it is likely to come up again. thx
I wouldn't think about "what is different?" but "why is it blowing up?" - you must be doing something fishy there. But we can't see that because it's not in the snippet you posted
It is this long chain that surely needs refactoring
as-> songInfo song
(first song)
(drop 2 song)
(map #(str/split % #" ") song)
(apply concat song)
(filter #(not (str/blank? %)) song)
(map #(str/split % #"/") song)
(cons ["X" "X" "4"] song)
(swap! state/app-state assoc-in [:song] song)))
the map / apply concat lines can be replaced with (mapcat #(str/split % #" ") song)
something ends up as the first element of a vector which is interpreted by reagent as a component
@noisesmith got it, thx
@pesterhazy Ok, I’ll trace everything through and see what I’m doing. Still at the hacking stuff together phase of learning. Thanks for the help
@pesterhazy I was displaying the final transformed data in my view for debugging and sure enough, that was the issue. Thanks again.