degree9 / firebase-cljs

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

Simple example #17

Closed octaviogb closed 8 years ago

octaviogb commented 8 years ago

Is there a simple example showing how to basically use this library?

burn2delete commented 8 years ago

@octaviogb This library was originally designed after matchbox So there are some familiarities to the API. Currently there isnt any simple demo, however there are many projects using it under my user account.

Init Firebase:

(fb/init
    {:apiKey FIREBASE_API_KEY
     :authDomain FIREBASE_AUTH_DOMAIN
     :databaseURL FIREBASE_DATABASE_URL
     :storageBucket FIREBASE_STORAGE_BUCKET})

(def auth (fb/get-auth))

(def app  (fb/get-app))

(def db   (fbdb/get-in (fb/get-db) [:somepath]))

If you let me know what you are looking to do I can whip up some example code.

burn2delete commented 8 years ago

In your ns:

(:require [cljsjs.firebase]
          [firebase-cljs.core :as fb]
          [firebase-cljs.database :as fbdb]
          [firebase-cljs.database.query :as fbdq])
octaviogb commented 8 years ago

Thank you!!!