https://github.com/appbaseio/appbasereact-needsupdate
React mixin of appbase integration.
https://github.com/appbaseio/appbasereact-needsupdate
Last synced: about 1 year ago
JSON representation
React mixin of appbase integration.
- Host: GitHub
- URL: https://github.com/appbaseio/appbasereact-needsupdate
- Owner: appbaseio
- Created: 2015-11-05T05:55:23.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-06T04:45:26.000Z (almost 11 years ago)
- Last Synced: 2025-06-19T03:06:40.556Z (about 1 year ago)
- Language: HTML
- Size: 1.24 MB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AppbaseReact
React mixin of appbase integration.
## To use appbase mixin
```
var Container = React.createClass({
mixins:[AppbaseReact],
....
```
## bindArray
To get streaming result in array, you can use this method, it will update you with new data and merging them in Array.
```
this.bindArray(searchQuery,'search_response');
//here searchQuery is Appbase stream query
//Example of searchquery
var searchQuery = this.appbaseRef.searchStream({
type: "tweet",
body: {
query: {
match_all: {}
}
},
streamOnly:true
});
```
in this example you can access response data by using "this.state.search_response"
## bindObject
To get streaming result in object, you can use this method, it will always update you with new data.
```
this.bindObject(searchQuery,'search_response');
//here searchQuery is Appbase stream query
//Example of searchquery
var searchQuery = this.appbaseRef.searchStream({
type: "tweet",
body: {
query: {
match_all: {}
}
},
streamOnly:true
});
```
in this example you can access response data by using "this.state.search_response"