This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-16
Channels
- # admin-announcements (27)
- # beginners (17)
- # boot (216)
- # cider (13)
- # cljs-dev (4)
- # clojure (103)
- # clojure-berlin (2)
- # clojure-dev (18)
- # clojure-italy (14)
- # clojure-japan (1)
- # clojure-nl (4)
- # clojure-norway (1)
- # clojure-russia (8)
- # clojurescript (291)
- # clojurex (12)
- # datomic (31)
- # editors (1)
- # events (16)
- # hoplon (60)
- # jobs (1)
- # ldnclj (85)
- # luminus (15)
- # onyx (2)
- # re-frame (18)
- # reagent (36)
- # remote-jobs (3)
- # yada (3)
I've done it where i convert markdown to html then use dangerously set inner html https://facebook.github.io/react/tips/dangerously-set-inner-html.html
Also, here is a recipe with a link to a blog post about markdown. https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/markdown-editor
Oh, I mean something much more prosaic. Reagent’s semi-hiccup is nice for structuring the page, but rough for formatting text I’m writing in templates. I’d like to avoid [:p “Template syntax like “ [:strong “this”] “!”]
@tel: Not reagent - but you might learn something from looking at the hoplon code — they use markdown extensively in some of their demos : https://github.com/tailrecursion/hoplon.io/blob/master/src/index.cljs.hl#L96-L104
@tel - here is the macro they use : https://github.com/tailrecursion/hoplon.io/blob/master/src/util.clj#L26-L33
So looks like they are processing the MD as part of generating the code — and not processing on the clojurescript/client side.
Figwheel-reloadable local state in Reagent: http://vvvvalvalval.github.io/posts/2015-09-16-bottup-approach-to-reagent-state.html
@jaen: what did you find hard about hooking into dispose
in Reagent?
I'd have to go over the code again, it was a while ago, I can get back to you with more details later-ish, after I go read that code again, if you want.
But basically I wanted to have reactive query objects - I do (logic/query [:some datascript])
and get back a reactive object that forces re-render when the output of query changes. To do that I had to register datascript callbacks via d/listen!
and to not have this grow in an unbounded manner I would have to hook unlistening on when the reactive query gets disposed on component unmount.
@jaen I’m working on something veeeerry similar with RethinkDB
What we did was to create a Reaction off the Ratom, and add an :on-dispose
key in ratom/make-reaction
. When Reagent detects that the reaction isn’t being watched anymore it will call the on-dispose that cleans up the parent ratom
But same principle
It’s a little tied into re-frame, but none of it is re-frame exclusive
In general this feels like a good direction, some transient local state and automagic synchonisation of perrsistent state between the frontend and backend.
I didn't use reframe, but what I wrote was for myself was basically guided by reframe readme ; d
@jaen: If I'm understanding that means that any part of the UI that depends on those reactive queries re-renders on any db change, right?
@zane only if the query actually changes, Reagent won’t update otherwise (modulo identical? vs = checking)
Not sure if @jaen’s queries/datascript will return results from a query that are identical?
. If they are then Reagent won’t update, if they’re not identical it may. Depends a little on how it’s being used, I’m mostly familiar with re-frame’s pattern. More info in above link.