This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-13
Channels
- # admin-announcements (17)
- # aleph (1)
- # arachne (2)
- # boot (152)
- # braveandtrue (8)
- # cljs-dev (12)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (105)
- # clojure-austin (1)
- # clojure-belgium (5)
- # clojure-berlin (1)
- # clojure-brasil (5)
- # clojure-canada (2)
- # clojure-dev (6)
- # clojure-gamedev (1)
- # clojure-greece (9)
- # clojure-russia (39)
- # clojure-uk (9)
- # clojurescript (106)
- # component (4)
- # cursive (1)
- # data-science (3)
- # datascript (1)
- # datomic (9)
- # emacs (6)
- # hoplon (92)
- # jobs (1)
- # ldnproclodo (2)
- # lein-figwheel (1)
- # off-topic (19)
- # om (47)
- # om-next (1)
- # onyx (10)
- # other-languages (1)
- # proton (1)
- # re-frame (5)
- # reagent (36)
- # rethinkdb (1)
- # ring (2)
- # rum (1)
- # yada (14)
Ok Hoplon, quick question : In do-watch
, what is the init
argument?
(defn do-watch
([atom f]
(do-watch atom nil f))
([atom init f]
(with-let [k (gensym)]
(f init @atom)
(add-watch atom k (fn [_ _ old new] (f old new))))))
any examples?
(we need a docstring here!)
Let's build a docstring, okay?
Other question
I have a cell content-state
that gets updated once, when the db loads the content-state
data.
I have this in my views. (cell= (map #(view-item :id %) (map :id content-state))
And it gets slow
when click on a button, it takes a while to update, etc.
not sure
didn't know about Chrome profiler
thanks
It seems like (program) takes some time, what is this?
@dm3 r.handle the jquery thing takes a while
ok, no I get it better
scrolling down, I see a bit more
(do-watch fetch-db-success
#(when %2
(reset! content-state
(vectorify-all form-content-vectors %2))))
Can I close a do-watch
after the db is fetched, so after it's first f call (reset!) ?
^ @alandipert @micha interested to learn more
Oh, the loop-tpl thing seems slow too
ideally you'd extract some of you functions to top level from cells so that you could see them in the trace
Yes, in (cell= (map #(view-item :id %) (map :id content-state))
my view-item-fn
is pretty slow
But the thing is, if I could at least deref content-state
when db-fetch is done, I could save some time I think
But How to deref-once-loaded?
not sure how
I already have this
(do-watch fetch-db-success
#(when %2
(reset! content-state
(vectorify-all form-content-vectors %2))))
Not sure where to deref what
@donmullen: we just deploy to ASGs now, without beanstalk
we have some simple scripts that we use to create ASGs with a user-data script that knows how to download application and run a Makefile
but the overall organization is similar to beanstalk, eg. we have the concept of "applications" which can contain "environments"
even if it will only contain a single instance, we still have that instance created by an ASG
@micha - Interesting - thanks. Anything OSS yet - or planned? — similar to boot-beanstalk?
like if you have an environment named foo-prod, all the things in AWs will be named foo-prod
@dm3: was 10x faster when content-state
was hardcoded and static
my state machine is bad 😞
it seems you're waiting for the network call to finish in order to make the first render, no?
I could do it server side and pass in params to hoplon page?
What could I do on the client?
(pretending I rely on rpc call)
(no server prerendering)
I do it already
It is slow, but my problem is more, when I interact with stuff like buttons
the delay is huge
because content-state get updated
so you press a button, then content-state gets updated, then you recompute the view-items which takes all the time?
Thanks @dm3
I solved the lagging problem 1.4s -> 0.15 s
I create a second cell that has the same data but is not updated
works like a charm!
I now need to find a way to pre-fetch data...
will study castra