Fork me on GitHub
#cljsrn
<
2017-04-20
>
vikeri07:04:22

Realm is synchronous (weirdly enough for js land) and it’s also super fast so I recommend it for storage. But in @benny’s case I’d just keep the token in memory

openaki10:04:33

Hi guys, I am trying to make a simple app using exponent and re-natal. I am having trouble using firebase. The moment I add [cljsjs.firebase :as cfb] in my 'require' dependency, I get the error "Can't find varaible: self". I have added [cljsjs/firebase "3.5.3-1"] to my 'project.clj'. Please let me know if I am doing something wrong (still new to clojure.)

vikeri13:04:42

@openaki I generally use npm dependencies in package.json and then use (js/require "module") in my cljs code. The RN packager does a lot of “magic” and this seemed to work best for me.

benny14:04:21

@vikeri that's the plan with the access token but I plan to store my refresh token

benny14:04:15

Realm seems like overkill for that imo

benny14:04:24

Wouldn't you agree

vikeri14:04:14

@benny Yeah Realm might totally be an overkill if you don’t need to store other stuff like part of the re-frame atom. I would still keep the refresh token in memory by loading it from storage the first thing I do when I start the app.

benny14:04:23

Agreed but that's ultimately what I'm trying to solve is storing for subsequent launches

benny14:04:47

Any suggestions how to do that with re-frame by chance?

benny14:04:09

I haven't found an ideal solution yet

vikeri14:04:23

We just have a reg-fx that sends stuff to be written

benny14:04:44

So you don't wait for the token from storage you just fire and forget

vikeri14:04:33

I don’t know what kind of token you’re talking about, I presume to authenticate to some kind of API?

benny14:04:28

Access token is short lived. I planned on assuming it would be expired upon launch so I was going to grab a new access token using a previously stored refresh token

vikeri14:04:57

@benny Ok, I would just get the refresh token from the storage directly and then in the callback from the storage get do a fetch to get an access token. Nothing fancy

vikeri14:04:29

core async is very nice but for one off cases I don’t think callbacks are too bad.

benny16:04:42

Do you use callback heaven or just plain cljs @vikeri

vikeri16:04:47

@benny plain ol cljs

misha20:04:04

https://github.com/frankiesardo/lumo-vr

Run a ReactVR application with ClojureScript

openaki23:04:32

Thanks @vikeri , bumping down the version on cljsjs/firebase to 3.2.* solved the problem

openaki23:04:17

Btw, does anyone here have any experience with degree9/firebase-cljs, the library does have docs but an example would really help. I am not able to get updates from firebase (most likely am using the library incorrectly.)