Skip to content

Commit

Permalink
tab fix
Browse files Browse the repository at this point in the history
  • Loading branch information
steveruizok committed Apr 20, 2018
1 parent 2be2db3 commit d5baa53
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ These examples include access to a public demo database for the purpose of demon
## Getting started in under 5 minutes

<a href='https://open.framermodules.com/Firebase'>
<img alt='Install with Framer Modules'
src='https://www.framermodules.com/assets/[email protected]' width='160' height='40' /></a>
<img alt='Install with Framer Modules'
src='https://www.framermodules.com/assets/[email protected]' width='160' height='40' /></a>

<strong>OR</strong>

Expand Down Expand Up @@ -110,8 +110,8 @@ The required information is located at https://firebase.google.com → *Console*

```coffee
firebase = new Firebase
projectID: ___________ # 1) ... Database → first part of URL
secret: ______________ # 2) ... Project Settings → Service Accounts → Database Secrets → Show (mouse-over)
projectID: ___________ # 1) ... Database → first part of URL
secret: ______________ # 2) ... Project Settings → Service Accounts → Database Secrets → Show (mouse-over)
```


Expand All @@ -136,8 +136,8 @@ If you wish not to use and share your database *secret* in your Framer project l
```json
{
"rules": {
".read": "true",
".write": "true"
".read": "true",
".write": "true"
}
}
```
Expand Down Expand Up @@ -198,27 +198,27 @@ Retrieves data from the database.
```coffee
# Simple 1, expecting single value
firebase.get "/value", (value) ->
print value
print value

# Promise
firebase.get "/value"
.then (value) -> print value

# Simple 2, expecting dataset
firebase.get "/names", (names) ->
namesArray = _.toArray(names) # converts JSON to array
print name for name in namesArray
namesArray = _.toArray(names) # converts JSON to array
print name for name in namesArray

# Promise
firebase.get "/names"
.then (names) ->
namesArray = _.toArray(names) # converts JSON to array
print name for name in namesArray
namesArray = _.toArray(names) # converts JSON to array
print name for name in namesArray

# Advanced
response = (names) ->
namesArray = _.toArray(names)
print name for name in namesArray
namesArray = _.toArray(names)
print name for name in namesArray

firebase.get("/names",response,{orderBy: "$key", limitToFirst: 5})

Expand Down Expand Up @@ -248,7 +248,7 @@ firebase.put("/value", true)

# Advanced
response = (confirmation) ->
print confirmation
print confirmation

firebase.put("/values", {"foo": true, "bar": false}, response)

Expand Down Expand Up @@ -277,19 +277,19 @@ firebase.post("/value", true)

# Advanced
firebase.post("/addressBook", { # JSON encoded:
"name" : {
"forename" : "Jane",
"surename" : "Doe"
}
"name" : {
"forename" : "Jane",
"surename" : "Doe"
}

"birthday" : {
"day" : 4,
"month": 7,
"year" : 1976
}
"birthday" : {
"day" : 4,
"month": 7,
"year" : 1976
}

"tel" : "202-555-0101"
})
"tel" : "202-555-0101"
})

```
<br />
Expand Down Expand Up @@ -332,14 +332,14 @@ Fires, when the Framer project is loaded (returns all current data of the path)

# Simple
firebase.onChange "/values", (value) ->
print value
print value

# Advanced
response = (data, method, path, breadcrumbs) ->
# method returns either `put´ or `patch´, depending on what method changed the data
# path returns the path that was changed
# breadcrumbs returns the path as segments (array)
print "received #{data} via #{method}"
# method returns either `put´ or `patch´, depending on what method changed the data
# path returns the path that was changed
# breadcrumbs returns the path as segments (array)
print "received #{data} via #{method}"

firebase.onChange("/values", response)

Expand All @@ -355,8 +355,8 @@ Fires, whenever the connection status to Firebase has changed.
```coffee

firebase.onChange "connection", (status) ->
# status is either `connected´ or `disconnected´
print "Hooray, we're connected to Firebase" if status is "connected"
# status is either `connected´ or `disconnected´
print "Hooray, we're connected to Firebase" if status is "connected"

# Or

Expand Down Expand Up @@ -395,11 +395,11 @@ For further information on how to order or limit requests please refer to [Fireb
```JSON

{
"rules": {
".read": "auth != null",
".write": "auth != null",
"routes": {".indexOn": ["distance"]}
}
"rules": {
".read": "auth != null",
".write": "auth != null",
"routes": {".indexOn": ["distance"]}
}
}

```
Expand Down

0 comments on commit d5baa53

Please sign in to comment.