This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (6)
- # bangalore-clj (1)
- # beginners (15)
- # boot (4)
- # cider (14)
- # clara (1)
- # cljs-dev (1)
- # clojure (115)
- # clojure-art (1)
- # clojure-france (1)
- # clojure-greece (1)
- # clojure-korea (9)
- # clojure-russia (1)
- # clojure-spec (62)
- # clojure-taiwan (1)
- # clojure-uk (18)
- # clojurescript (5)
- # component (1)
- # cursive (3)
- # datascript (2)
- # datomic (17)
- # devcards (2)
- # editors (4)
- # emacs (65)
- # events (2)
- # funcool (4)
- # hoplon (92)
- # jobs (6)
- # london-clojurians (1)
- # luminus (1)
- # midje (2)
- # mount (1)
- # off-topic (1)
- # onyx (51)
- # protorepl (6)
- # re-frame (116)
- # reagent (7)
- # ring (2)
- # spacemacs (2)
- # specter (4)
- # untangled (1)
- # yada (1)
So I think dynamic style is the way to go, hmm? Only I need to refresh the element after modifying the dom.
There is only a certain number of styles that could possibly be used, you should be toggling based on that list
Yeah. So my next attempt will set the value to be displayed in the innerHTML, which will likely cause the refresh.
Is there a good way to make window.setInterval play nicely with live code reloading?
I have a cell that I want to increase by one every second but, beside using defonce store the result of calling setInterval, I'm not sure if there's a good way to prevent the interval function from being called more frequently.
i have definitely come up against subtle bugs in my code from the specific order of cells doing their thing
@flyboarder it works! I set the content after the element is created and after setting the style dynamically by assigning it to innerHTML--which forces the refresh. Also complicating things was that, when displaying multiple lines, I was grabbing the wrong element. But anyway, I am happy that I can reuse elements in a scrollable display with dynamic styling. Thanks!
@laforge49 is that public? The way you are describing seems like as you are fighting Hoplon. If it's public I would like to take a look.
@mynomoto You are right. I don't need some of this and could go back now and drop it. I can just add the style in the div itself. Anyway, here's the code: https://github.com/rolonicArk/simpleArk/blob/master/src/console/client.cljs
Start with the do-console called at the end of the module. The console is displayed at the end of that. Then look at add-output which adds content to the console display.
@mynomoto No rush. I've now cleaned up the code. No more "dynamic styling". I'm groovin with Hoplon! 🙂
@thedavidmeister it took me a while to figure out what you meant, but I think a recursive setTimeout might be the way to go @mynomoto defonce works, but it makes it annoying to experiment with the defonced value.
@fiddlerwoaroof you can cancel the setInterval and create another one. You get an id when you define it.
@micha cool! Is it ok to merge the docs generated with codox? We will gain some visibility over the public API, I can add docs later.
There is lots of missing docs but there is a list of public things. You may want to take a look to see if there is something that shouldn't be public 😉
Oh sorry I just looked at the namespaces, I guess there aren't docs for multimethods the hoplon.jquery stuff
@flyboarder I picked codox as it has a klipse plugin if we ever get that to work it would be amazing for docs.
@mynomoto Yeah, but it looks broken. I've been making too many changes too quickl. 🙂
I was watching @shaun-mahood presentation from the conj and it made me start thinking about the structure of applications
then the other side is the "presentation", which is hoplon defelems that can be hooked up to the state machines
in general i guess the way i think of it is that at the end of the day you want to present a browser dom interface to the user
so to hook the state machine up to some ui compoenent(s) you would wire up the fields of the state machine (which are cells) to the attributes of the component
so in larger applications we should be using records of cells instead of just cells?
if i can factor out the workflow, or some aspect of it, then i make a state machine thingy
that really simplifies the appliaction because then i can make more powerful components
very interesting, i have a theme developing for this tutorial on mental models for web apps, the nice thing about hoplon is that the ast is the dom structure so you can see the dom by looking at the code