Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit cd31409

Browse files
Merge pull request #517 from 38elements/master
Fix example in document
2 parents 84c74a5 + 31b6767 commit cd31409

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

doc/gettingstarted/events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Cleaning up of the event handler is taken care of by the `Disposable` object ret
3838

3939
The `fromEvent` method also supports adding event handlers to multiple items, for example a DOM NodeList. This example will add the 'click' to each element in the list.
4040

41-
```
41+
```js
4242
var result = document.getElementById('result');
4343
var sources = document.querySelectorAll('div');
4444

@@ -51,7 +51,7 @@ var subscription = source.subscribe(function (e) {
5151

5252
In addition, `fromEvent` also supports libraries such as [jQuery](http://jquery.com/), [Zepto.js](http://zeptojs.com/), [AngularJS](https://angularjs.org/), [Ember.js](http://emberjs.com/) and [Backbone.js](http://backbonejs.org):
5353

54-
```
54+
```js
5555
var $result = $('#result');
5656
var $sources = $('div');
5757

doc/mapping/bacon.js/whyrx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ These `compat` files are important as we will shim behavior that we require such
119119
RxJS has a firm commitment to standards in JavaScript. Whether it is supporting the `Array#extras` standard method signatures such as `map`, `filter`, `reduce`, `every` and `some`, or to some new emerging standard on collections, RxJS will implement these features accordingly from pull collections to push. Unlike Bacon.js, RxJS conforms to `Array#extras` syntax to have the callback style of `function (item, index, collection)` in addition to accepting a `thisArg` for the calling context of the callback. This helps as you can easily reuse your code from the Array version to Observable version.
120120

121121
An example of forward thinking is the introduction of ES6+ operators on Array with implementations on Observable such as:
122-
- `contains`
122+
- `includes`
123123
- `find`
124124
- `findIndex`
125125
- `from`
@@ -132,7 +132,7 @@ This makes the following code possible to yield an array from an observable sequ
132132
```js
133133
Rx.Observable.range(1, 3)
134134
.flatMap(function (x, i) { return [x, i]; })
135-
.subscribeNext(function (value) {
135+
.subscribeOnNext(function (value) {
136136
console.log('Value: %o', value);
137137
});
138138
// => 1
@@ -152,7 +152,7 @@ var source = Rx.Observable.from(
152152
function* () { yield 1; yield 2; yield 3; }()
153153
);
154154

155-
source.subscribeNext(function (value) {
155+
source.subscribeOnNext(function (value) {
156156
console.log('Next: %s', value);
157157
});
158158

doc/mapping/highland/whyrx.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ These `compat` files are important as we will shim behavior that we require such
115115
RxJS has a firm commitment to standards in JavaScript. Whether it is supporting the `Array#extras` standard method signatures such as `map`, `filter`, `reduce`, `every` and `some`, or to some new emerging standard on collections, RxJS will implement these features accordingly from pull collections to push. Unlike Highland.js, RxJS conforms to `Array#extras` syntax to have the callback style of `function (item, index, collection)` in addition to accepting a `thisArg` for the calling context of the callback. This helps as you can easily reuse your code from the Array version to Observable version.
116116

117117
An example of forward thinking is the introduction of ES6+ operators on Array with implementations on Observable such as:
118-
- `contains`
118+
- `includes`
119119
- `find`
120120
- `findIndex`
121121
- `from`
@@ -128,7 +128,7 @@ This makes the following code possible to yield an array from an observable sequ
128128
```js
129129
Rx.Observable.range(1, 3)
130130
.flatMap(function (x, i) { return [x, i]; })
131-
.subscribeNext(function (value) {
131+
.subscribeOnNext(function (value) {
132132
console.log('Value: %o', value);
133133
});
134134
// => 1
@@ -148,7 +148,7 @@ var source = Rx.Observable.from(
148148
function* () { yield 1; yield 2; yield 3; }()
149149
);
150150

151-
source.subscribeNext(function (value) {
151+
source.subscribeOnNext(function (value) {
152152
console.log('Next: %s', value);
153153
});
154154

0 commit comments

Comments
 (0)