This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-19
Channels
- # aws-lambda (4)
- # beginners (62)
- # cider (20)
- # cljs-dev (9)
- # cljsrn (13)
- # clojars (3)
- # clojure (105)
- # clojure-brasil (1)
- # clojure-denver (1)
- # clojure-finland (4)
- # clojure-italy (23)
- # clojure-norway (1)
- # clojure-spec (6)
- # clojure-uk (56)
- # clojurescript (41)
- # cursive (10)
- # datomic (25)
- # emacs (23)
- # figwheel (2)
- # fulcro (133)
- # graphql (12)
- # hoplon (32)
- # instaparse (13)
- # keechma (1)
- # lein-figwheel (1)
- # luminus (1)
- # lumo (1)
- # nyc (2)
- # off-topic (34)
- # om (2)
- # onyx (10)
- # pedestal (8)
- # portkey (1)
- # re-frame (10)
- # reagent (26)
- # ring (8)
- # shadow-cljs (77)
- # spacemacs (4)
- # sql (8)
- # tools-deps (15)
- # vim (9)
@alandipert Yes, it is confusing how the compilation model in cljs and the REPL can co-exist. But I will go for your advice. I also learned to love the debux lib that is simple and powerful for pretty printing stuff in the console.
i just wrote this time syncing algo for javelin - https://github.com/thedavidmeister/javelin-timesync - for anyone who wants to sync UIs across devices
Is there any way to save the state of a Javelin cell when boot-reload reloads the JS code? The reason is that I am storing responses of REST calls in a cell and do not want to call the REST endpoint everytime I hit Save in my editor.
@vschepik hoplon.storage-cell
you can stick it in session storage or local storage
is that what you're asking?
(defonce state (hoplon.storage-atom/local-storage (j/cell nil) ::state))
(defonce nonce (hoplon.storage-atom/local-storage (j/cell nil) ::nonce))
(defonce token (hoplon.storage-atom/local-storage (j/cell nil) ::token))
this kind of thing
also you can memoize functions that return cells and get the same cell every time
you might find that handy
OK. It's not clear to me what boot-reload reloads. But I will try what you have suggested.
another thing i will do is comment out the code that fetches the value, and hardcode it
I did this in a different non-Hoplon project, too. But for that I had Emacs connected to a cljs repl in order to fetch the value directly into the editor. With Hoplon I had problems to get the cljs repl running but now it works.
oh, cool
defonce
is probably also better because using local storage or hardcoding require the saved object to be print-readable
it's not a macro or a function, it's compiled to ns
by the hoplon boot task. in hoplon.boot-hoplon.compiler
well, an ns
and conversion to .html
i think something like hoplon.app-pages.-index.html
you can see what it generates with boot hoplon show -f
to see the fileset after hoplon task runs
it might be better with a repl involved to not use page
or .hl
extension, and keep things vanilla cljs