mirror of
https://github.com/zhigang1992/reactfire.git
synced 2026-04-24 04:25:40 +08:00
Upgraded examples to ReactFire 0.2.0 and updated their READMEs
This commit is contained in:
@@ -1,32 +1,29 @@
|
||||
# CommentBox Example
|
||||
# ReactFire Comments Box Example
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
To run this example locally, either download the whole ReactFire repo or just this /commentBox/
|
||||
directory. From the /commentBox/ directory, install the needed dependencies via bower:
|
||||
To run this example locally, either download the whole ReactFire repository or just this
|
||||
`/commentsBox/` directory. Then replace the example Firebase URL with your own Firebase URL in the
|
||||
`index.html` file:
|
||||
|
||||
```bash
|
||||
$ bower install
|
||||
```
|
||||
|
||||
Then replace the example Firebase app URL with your Firebase app URL in
|
||||
the index.html file:
|
||||
|
||||
```
|
||||
```javaScript
|
||||
var firebaseApp = "https://my-firebase-app.firebaseio.com/"
|
||||
```
|
||||
|
||||
Finally, start up a server via Python (or your favorite method):
|
||||
Finally, start up a server via Python (or your preferred method):
|
||||
|
||||
```bash
|
||||
$ python -m SimpleHTTPServer 8080
|
||||
```
|
||||
|
||||
Now you should be able to visit the example in the browser of your choice at [http://127.0.0.1:8080/](http://127.0.0.1:8080/).
|
||||
You can then visit the example in the browser of your choice at [http://127.0.0.1:8080/](http://127.0.0.1:8080/).
|
||||
|
||||
|
||||
## Description
|
||||
The official [React tutorial](http://facebook.github.io/react/docs/tutorial.html) is
|
||||
a great introduction to React. This example replaces the REST-like server
|
||||
with Firebase and the ReactFireMixin.
|
||||
|
||||
The ReactFireMixin allows us to strip out the polling concept as well as the JQuery AJAX calls. The mixin allows you to bind right to your Firebase data and everything is kept in sync in real-time.
|
||||
The official [React tutorial](http://facebook.github.io/react/docs/tutorial.html) is a great
|
||||
introduction to React. This example replaces the REST-like server used in the tutorial with
|
||||
Firebase and the ReactFire mixin.
|
||||
|
||||
ReactFire allows us to strip out the polling concept as well as the jQuery AJAX calls. Instead,
|
||||
with the ReactFire mixin, we can bind right to Firebase and keep everything in sync in realtime.
|
||||
|
||||
Reference in New Issue
Block a user