This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-10
Channels
- # admin-announcements (2)
- # arachne (2)
- # beginners (53)
- # boot (52)
- # cider (7)
- # cljs-dev (61)
- # cljsrn (12)
- # clojure (61)
- # clojure-greece (22)
- # clojure-nl (16)
- # clojure-russia (103)
- # clojure-spec (84)
- # clojure-uk (15)
- # clojurescript (137)
- # community-development (14)
- # cursive (4)
- # datomic (14)
- # devcards (6)
- # euroclojure (3)
- # funcool (26)
- # hoplon (27)
- # jobs (4)
- # lambdaisland (1)
- # leiningen (1)
- # om (75)
- # onyx (77)
- # planck (15)
- # proton (2)
- # re-frame (23)
- # ring-swagger (9)
- # schema (1)
- # specter (95)
- # untangled (124)
- # yada (27)
@thedavidmeister: hoplon webdriver tests are looking great
Hi there, I'm looking into building a toy application to learn about the full hoplon stack (i.e. client- and serverside). I see that there is some documentation to get started with the client side, but the page on castra just says "Hello World". Should I be able to find myself around with just the castra readme, or is there anything else what I should read first?
@dot_treo: documentation is sparse at the moment, the README here is probably okay to get started: https://github.com/hoplon/castra
@dot_treo: there's also a hoplon-Castra template that demos minimal app with server side
castra doesn't try to do much at all, so this diagram is maybe a good way to see what it's trying to do: https://github.com/hoplon/castra/raw/master/img/arch-full.png
I want to map li to a cell with a vector. I get an error "is not ISeqable" if I do it this way (map li (cell= (state :past))) but it works if I do it this way (cell= (map li (state :past))). state is a cell defined as a dictionary with :past, :present, and :future. Why doesn't the former method work? (state :past) is a cell and cells aren't sequences, but what if that cell contains a sequence? I'm trying to make undo and redo.
also, how could I make this more efficient? instead of re-rendering all the list items each time an item is added or removed from the vector?
@mhr: (ul (for-tpl [x (cell= (state :past))] (li x))) perhaps?
it still seems to slow down when I call my undo function. I think it probably has more to do with how I wrote undo than the rendering. this is my undo function:
(defn undo! []
(when (> (count (@state :past)) 0)
; move present to front of future
(reset! state (assoc @state :future (vec (cons (@state :present) (@state :future)))))
; set present to final past item
(reset! state (assoc @state :present (peek (@state :past))))
; remove final past item
(reset! state (assoc @state :past (pop (@state :past))))))
Can you post the whole page? I can take a look
Nothing sticks out as slow
I've found that if I focus on any of the buttons and press enter so it continuously presses them, then it gets bogged down. if I press inc continuously, for instance, and present is incremented past 100, it gets slower. if I try to undo or redo continuously on a past or future of over 100 items, it also is slow. but on a past or future of about twenty items, it's still quick.