Skip to content

Commit

Permalink
Initial import of Cloud Firestore work.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbleigh committed Oct 7, 2017
1 parent 26fa71d commit 2f5d602
Show file tree
Hide file tree
Showing 7 changed files with 12,352 additions and 14 deletions.
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,20 @@ thing! https://github.com/PolymerLabs/tedium/issues
## <firebase-app>

The firebase-app element is used for initializing and configuring your
connection to firebase.
connection to firebase. It is only necessary to include this element once
in your application, and it equivalent to calling `firebase.initializeApp()`
in the JavaScript SDK.

```html
<firebase-app
auth-domain="polymerfire-test.firebaseapp.com"
database-url="https://polymerfire-test.firebaseio.com/"
api-key="AIzaSyDTP-eiQezleFsV2WddFBAhF_WEzx_8v_g"
storage-bucket="polymerfire-test.appspot.com"
messaging-sender-id="544817973908"
project-id="polymerfire-test">
</firebase-app>
```

## &lt;firebase-auth&gt;

Expand All @@ -30,13 +42,6 @@ workflows.
Example Usage:

```html
<firebase-app
auth-domain="polymerfire-test.firebaseapp.com"
database-url="https://polymerfire-test.firebaseio.com/"
api-key="AIzaSyDTP-eiQezleFsV2WddFBAhF_WEzx_8v_g"
storage-bucket="polymerfire-test.appspot.com"
messaging-sender-id="544817973908">
</firebase-app>
<firebase-auth id="auth" user="{{user}}" provider="google" on-error="handleError">
</firebase-auth>
```
Expand All @@ -58,8 +63,6 @@ This popup sign-in will then attempt to sign in using Google as an OAuth
provider since there was no provider argument specified and since `"google"` was
defined as the default provider.
## &lt;firebase-document&gt;
The firebase-document element is an easy way to interact with a firebase
Expand All @@ -83,8 +86,6 @@ and stored.
Set this configuration by adding a `<firebase-app>` element anywhere in your
app.
## &lt;firebase-query&gt;
`firebase-query` combines the given properties into query options that generate
Expand Down Expand Up @@ -122,4 +123,27 @@ Polymer({
</script>
```
## Polymer.FirestoreElement
A class mixin that provides Cloud Firestore bindings to your Polymer elements.
Import `firestore-element.html` to make the mixin available.
Example usage:
```js
class MyElement extends Polymer.FirestoreElement(Polymer.Element) {
// ...
static get properties() {
return {
user: {
type: Object,
doc: 'users/{uid}'
},
messages: {
type: Array,
collection: 'users/{uid}/messages'
}
}
}
}
```
Loading

0 comments on commit 2f5d602

Please sign in to comment.