This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-19
Channels
- # admin-announcements (1)
- # beginners (26)
- # boot (6)
- # cider (14)
- # cljsjs (29)
- # cljsrn (19)
- # clojure (87)
- # clojure-austin (5)
- # clojure-belgium (10)
- # clojure-brasil (2)
- # clojure-dusseldorf (15)
- # clojure-greece (17)
- # clojure-russia (51)
- # clojure-sanfrancisco (4)
- # clojure-sweden (20)
- # clojure-uk (31)
- # clojurescript (111)
- # core-matrix (2)
- # cursive (9)
- # datascript (15)
- # datomic (41)
- # dirac (1)
- # emacs (8)
- # flambo (1)
- # funcool (4)
- # hoplon (72)
- # lein-figwheel (3)
- # off-topic (2)
- # om (79)
- # om-next (2)
- # onyx (17)
- # other-languages (16)
- # re-frame (62)
- # reagent (26)
- # remote-jobs (1)
- # rum (3)
- # spacemacs (5)
- # untangled (120)
@knotschi: Try opening this url in your web browser and searching for “react-native-mixpanel”. If it’s not listed anywhere, it’s not being required. localhost:8081/index.ios.bundle
@frank: NavigationExperimental can work quite well with re-frame, a minimal example here: https://github.com/vikeri/re-navigate
Is there any best practice how to save re-frame
app state to AsyncStorage?
@savelichalex: Not best practice but for now I just serialized it ro edn and saved it to a single key. I added a persist middleware each time the state is updated and fetched the db when initializing the db. Very easy to add encryption but I know people have been looking at realm as well.
@vikeri: You apply middleware to every subscription? Right now I create reagent track!
for @reagent.db/app-db
and save after all changes
Well I am just saving a part of the state for now. In the future I was thinking of maybe creating a subscription that watches relevant parts of the state and saves it when it changes.
I don’t want to save things like where I am in the Nav and other ephemeral state parts
@vikeri: a suggestion which i don't know will work - why not add a add-watch
on re-frame.db/app-db
and watch for changes
@rohit: by track!
I’m doing such thing
Yeah to be honest I have not done my proper hammock time for this so I just went with something that worked for now.
@savelichalex: haven't had a look at track!
. it seems to have been added in the 0.6.0-x
release of reagent
so the way add-watch
works, on any change, you get old state and new-state. then you can diff the two pieces of data and do the necessary actions
What would be the difference between track
and re-frame’s subscribe
, I know the implementation is different but are there any practical differences?
I’m not familiar with implementation, but when I tried to subscribe
no one changes was detected. Maybe I just doing it wrong
@savelichalex: Subscribe works as expected for me. Have you checked the documentation?
@vikeri: Maybe you create snippet?