This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-29
Channels
- # arachne (3)
- # bangalore-clj (6)
- # beginners (246)
- # boot (57)
- # business (1)
- # capetown (1)
- # cider (2)
- # clara (1)
- # cljsjs (36)
- # cljsrn (1)
- # clojure (150)
- # clojure-austin (4)
- # clojure-brasil (7)
- # clojure-china (2)
- # clojure-france (3)
- # clojure-greece (3)
- # clojure-japan (3)
- # clojure-russia (38)
- # clojure-spec (25)
- # clojure-uk (25)
- # clojurescript (320)
- # clojurex (1)
- # cursive (38)
- # datascript (48)
- # datomic (23)
- # emacs (29)
- # events (1)
- # funcool (2)
- # hoplon (64)
- # jobs (3)
- # luminus (10)
- # off-topic (26)
- # om (27)
- # om-next (1)
- # onyx (1)
- # parinfer (38)
- # perun (5)
- # planck (19)
- # re-frame (38)
- # reagent (19)
- # remote-jobs (1)
- # rum (2)
- # schema (2)
- # spacemacs (1)
- # specter (8)
- # test-check (10)
- # vim (7)
- # yada (14)
@shaun-mahood is obviously at Conj this week, anyone else?
I’m mainly a lurker here but have been building my first re-frame side project this year. Will be at the Conj and interested in meeting up and talking re-frame
@motor4k, are you the author of DataFrisk? I love that library
I see, 👍 to @odinodin then!
re-frame 0.9.0-alpha1 https://groups.google.com/forum/#!topic/clojurescript/p5W94H3OD6Q
A question about testing, I try to do with-redefs
which works fine as long as i use dispatch-sync
in my tests. But when I have a normal dispatch
event the redef’ed function goes back to standard. I guess this is due the asynchronous implementation of dispatch under the hood? A question is how people solve that? Would it be solved if I used re-frame-test?
what do I have to do to make the re-frame simple example preserve state when figwheel reloads? ie the content of the input gets reset to the default value when figwheel reloads currently. https://github.com/Day8/re-frame/tree/master/examples/simple)
@jstaffans that should work actually
what I'd do is to start debugging where reloading goes off the rails
I'd start by adding logging to the render functions, printing out global state
isolate if global state gets updated incorrectly
the simple example seems a bit too simple also in that it doesn't re-render the root component (there's no on-js-reload fn as far as I can see)
it might be worth copy'n pasting the example into tenzing (or chestnut if you prefer lein?)
I suspect the issue is not to do with re-frame but with reagent or tooling by the way
Thanks @pesterhazy, I'll try that out
a couple of other reloading gotchas:
- using clojure.core/atom instead of reagent.core/atom
- forgetting to use #'component
to enable reloading
- top-level root component sometimes don't get updated properly; wrap in another component to be sure
- "rookie mistake"? https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-1-a-simple-function
- input fields: default-value
vs value
- logic check: does the component to update deref the ratom?
- defmethod based components can be wonky in reagent
- on-js-reload should re-mount root component
With the help of @andre, a re-frisk
option as been added to re-frame-template. lein new re-frame myapp +re-frisk
maybe i’m doing something silly but i’ve just noticed i don’t really have reloadability when i’m coding my subscriptions using figwheel. any ideas? using version 0.8.0
i do get the message re-frame: overwriting :sub handler for: :subscription-name
but it just sticks with what was there when the page loaded
btw @jstaffans I just made it so my initialize event checks to see if DB is empty?
before it throws anything in it and my state is preserved
does it make sense to investigate Rum as an alternative to reagent in the context of a re-frame application?
@naomarik that's the one
@vikeri what are you rebinding with with-redefs
?
@vikeri oh, now I get what you are saying.
Yes, you are right. dispatch
is async. So the event handling will happen "later" after the scope of the with-redef
@joshkh It certainly makes sense. But you'd have to adapt re-frame to Rum, creating a sibling library called perhaps re-bellion (the "Rum rebellion" was a piece of Australian History. I'll get my hat.) so there would be some work involved.