Clojurians
#cljsrn
<
2016-05-19
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

seantempesta00:05:11

@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

vikeri07:05:50

@frank: NavigationExperimental can work quite well with re-frame, a minimal example here: https://github.com/vikeri/re-navigate

savelichalex07:05:58

Is there any best practice how to save re-frame app state to AsyncStorage?

vikeri09:05:15

@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.

savelichalex09:05:34

@vikeri: You apply middleware to every subscription? Right now I create reagent track! for @reagent.db/app-db and save after all changes

vikeri09:05:10

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.

vikeri09:05:38

I don’t want to save things like where I am in the Nav and other ephemeral state parts

rohit09:05:10

@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

savelichalex10:05:25

@rohit: by track! I’m doing such thing

vikeri10:05:49

Yeah to be honest I have not done my proper hammock time for this so I just went with something that worked for now.

rohit10:05:51

@savelichalex: haven't had a look at track!. it seems to have been added in the 0.6.0-x release of reagent

rohit10:05:01

will definitely investigate

rohit10:05:06

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

vikeri10:05:43

What would be the difference between track and re-frame’s subscribe, I know the implementation is different but are there any practical differences?

savelichalex10:05:58

I’m not familiar with implementation, but when I tried to subscribe no one changes was detected. Maybe I just doing it wrong

vikeri11:05:15

@savelichalex: Subscribe works as expected for me. Have you checked the documentation?

savelichalex12:05:13

@vikeri: Maybe you create snippet?

frank14:05:22

thanks @vikeri

grav20:05:42

Has anyone used sente with re-natal? Seems the cljx files give problems.