Fork me on GitHub
#cljsrn
<
2016-01-31
>
alwx00:01:01

I've updated my example of React Native application. It now saves all the data internally and restores the application state after reloading. It also became possible to remove cities (use long tap to do it). @drapanjanas also updated React Native and re-natal (thank you!). Seems like it is the most complex example of real-life React Native CLJS application, and I hope it is useful for community. https://github.com/alwx/luno-react-native

donmullen00:01:56

@alwx - will you summarize how you are doing the local data storage? Does it work cross platform. Will take a look at the code - not at computer currently.

alwx08:01:30

@donmullen: it is much easier than saving data internally in native applications simple_smile look here: https://github.com/alwx/luno-react-native/blob/master/src/luno/db.cljs If you want to save data, you need to call upsert! function this way:

(db/upsert! :city {:where {:name {:eq city}}} city-object)
Loading data is a bit more tricky, but simple too.

artemyarulin09:01:36

has anybody thought about using datascript as a DB for RN applications?

drapanjanas10:01:00

I’d like to make datascript work with re-frame subscriptions, but haven’t done anything yet. There was a discussion here about the same https://github.com/Day8/re-frame/issues/36 looks like doable

artemyarulin10:01:42

@drapanjanas: What is your opinion about datascript in general?

drapanjanas10:01:32

@artemyarulin I like datomic and using it in backend of my free-time project. So I'd really like to try it as a db in front end application, though haven't used it so far

artemyarulin10:01:45

I’m just a bit confused that om-next kinda have their own language and the way how to work with state object, datomic pretty much does the same

drapanjanas11:01:24

RN 0.19.0 is out, noticed that packager now says [Hot Module Replacement] Server listening on /hot does anybody knows how it works? Maybe some new figwheel’ish aproach is now possible?

jethroksy15:01:40

has anyone seen a BLE module for RN?

jellea17:01:10

artemyarulin: we're using datascript with rn

artemyarulin17:01:32

@jellea: Are you using om-next or reagent?

jellea17:01:41

artemyarulin: reagent

artemyarulin17:01:35

what is your opinion about datascript in general?

jellea17:01:35

Have mixed feelings about datascript on iOS. Think its one of the causes of our perf issues

artemyarulin17:01:08

how big is your DB? Everything is in memory, so I guess it should be damn fast?

jellea17:01:00

artemyarulin: but resolving the queries is not that fast

jellea17:01:45

we lazy load the local db like with om.next

artemyarulin17:01:27

do you know btw om-next? Does it make any sense to use datascript with it?

artemyarulin17:01:40

Looks like functionality overlaps

jellea17:01:06

artemyarulin: yeah it overlaps, but believe om-next has its own implementation

jellea17:01:16

w querying

jellea17:01:43

I'm more interested in raw FRP at the moment, like Petrol

artemyarulin17:01:11

@jellea: Thanks for the info, I’ll have a look and play with datascript

jellea17:01:41

artemyarulin: youre welcome!