Skip to content

Commit

Permalink
Add streaming to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuecklers committed Nov 8, 2016
1 parent d025775 commit 7e61804
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Or [download the latest release](https://github.com/Baqend/js-sdk/releases/lates
You can also include it from our CDN-Provider `fastly`.
```html
<!-- for development -->
<script type="text/javascript" src="//baqend.global.ssl.fastly.net/js-sdk/latest/baqend.js"></script>
<script type="text/javascript" src="//www.baqend.com/js-sdk/latest/baqend.js"></script>
<!-- for production -->
<script type="text/javascript" src="//baqend.global.ssl.fastly.net/js-sdk/latest/baqend.min.js"></script>
<script type="text/javascript" src="//www.baqend.com/js-sdk/latest/baqend.min.js"></script>
```

The Baqend SDK provides a global `DB` variable by default.
Expand Down Expand Up @@ -60,6 +60,21 @@ DB.ready(function() {
</script>
```

Baqend Streaming SDK

If you want to use the realtime streaming queries, you have to either use `baqend-streaming.js` or
`baqend-streaming.min.js` for production.

In Addition, you must include [Rx.js](https://github.com/ReactiveX/rxjs) v5 into your project.
As minimal setup, the rxjs Observable is required.
You can use the unpkg CDN:

```html
<script type="text/javascript" src="//unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
<!-- include the SDK after rxjs -->
<script type="text/javascript" src="//www.baqend.com/js-sdk/latest/baqend-streaming.js"></script>
```

Usage in Node.js
----------------

Expand All @@ -79,6 +94,11 @@ DB.ready(function() {
});
```

Note: The Baqend Streaming SDK can be required with `var DB = require('baqend/streaming');`, ensure that you only
require either the Baqend SDK or the Baqend Streaming SDK and not both.



Building with [browserify](http://browserify.org/)
--------------------------------------------------

Expand All @@ -99,6 +119,9 @@ DB.ready(function() {
});
```

Note: The Baqend Streaming SDK can be required with `var DB = require('baqend/streaming');`, ensure that you only
require either the Baqend SDK or the Baqend Streaming SDK and not both.

Type `browserify scripts/main.js > scripts/bundle.js` to build your main.js script.
For more advanced building steps visit the [browserify Documentation](https://github.com/substack/node-browserify#usage).

Expand Down
2 changes: 1 addition & 1 deletion spec/stream.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe("Streaming Queries", function() {
return helper.sleep(t).then(function() {
expect(results.length).to.be.equal(1);
expect(results[0].operation).to.be.equal('none'); //transitive remove --> the was no operation on this objects
expect(results[0].matchType).to.be.equal("match");
expect(results[0].matchType).to.be.equal("add");
expect(results[0].data.name).to.be.equal("Al");
expect(results[0].index).to.be.equal(0);

Expand Down

0 comments on commit 7e61804

Please sign in to comment.