degree9 / firebase-cljs

Another set of Firebase CLJS bindings.
MIT License
26 stars 4 forks source link

How to use this? #25

Open theronic opened 7 years ago

theronic commented 7 years ago

A one-line example of how to include this and then use it from Cljs would go a long way :)

DavidYKay commented 7 years ago

I'm puzzling it together right now. Ping me again in a few weeks and I may be able to write something up.

burn2delete commented 7 years ago

This lib needs an update, the best usage is currently: https://github.com/hoplon/brew/blob/master/src/hoplon/firebase.cljs.hl

torgeir commented 7 years ago

Here's an tiny example to kick things off if someone stumbles over here

(ns some.core
  (:require [firebase-cljs.core :as fb]
            [firebase-cljs.auth :as fb.auth]
            [firebase-cljs.database :as fb.database]
            [firebase-cljs.auth.provider :as fb.auth.provider]
            ))

(defonce fb-init
  (do
    (fb/init
      {:apiKey ""
       :authDomain ""
       :databaseURL ""
       :storageBucket ""})
    (fb.auth/login-popup
      (fb/get-auth)
      (fb.auth.provider/google))))

(defonce db (fb/get-db))
(fb.database/reset! db {:it "works"})
(fb.database/remove! db)