You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project provides Reactive Extensions for JavaScript (RxJS) bindings for jQuery to abstract over the event binding, Ajax and Deferreds. The RxJS libraries are not included with this release and must be installed separately.
6
6
7
7
## GETTING STARTED
8
8
9
-
There are a number of ways to get started with the jQuery Bindings for RxJS.
9
+
There are a number of ways to get started with the jQuery Bindings for RxJS. The files are available on [cdnjs](http://cdnjs.com/) and [jsDelivr](http://www.jsdelivr.com/#!rxjs-jquery).
10
10
11
11
### Download the Source
12
12
@@ -15,6 +15,18 @@ To download the source of the jQuery Bindings for the Reactive Extensions for Ja
@@ -89,14 +101,11 @@ Now that we have the throttled input from the textbox, we need to query our serv
89
101
});
90
102
}
91
103
92
-
Now that the Wikipedia Search has been wrapped, we can tie together throttled input and our service call. In this case, we will call select on the throttledInput to then take the text from our textInput and then use it to query Wikipedia, filtering out empty records. Finally, to deal with concurrency issues, we'll need to ensure we're getting only the latest value. Issues can arise with asynchronous programming where an earlier value, if not cancelled properly, can be returned before the latest value is returned, thus causing bugs. To ensure that this doesn't happen, we have the [switchLatest](http://msdn.microsoft.com/en-us/library/hh229197\(v=VS.103\).aspx) method which returns only the latest value.
104
+
Now that the Wikipedia Search has been wrapped, we can tie together throttled input and our service call. Finally, to deal with concurrency issues, we'll need to ensure we're getting only the latest value. Issues can arise with asynchronous programming where an earlier value, if not cancelled properly, can be returned before the latest value is returned, thus causing bugs. To ensure that this doesn't happen, we have the [switchLatest](http://msdn.microsoft.com/en-us/library/hh229197\(v=VS.103\).aspx) method which returns only the latest value.
93
105
94
106
var suggestions = throttledInput.select( function (text) {
95
107
return searchWikipedia(text);
96
108
})
97
-
.where( function (data) {
98
-
return data.length == 2 && data[1].length > 0;
99
-
})
100
109
.switchLatest();
101
110
102
111
Finally, we'll subscribe to our observable by calling subscribe which will receive the results and put them into an unordered list. We'll also handle errors, for example if the server is unavailable by passing in a second function which handles the errors.
@@ -177,7 +186,7 @@ We've only scratched the surface of this library in this simple example.
177
186
178
187
## LICENSE
179
188
180
-
Copyright 2011 Microsoft Corporation
189
+
Copyright 2013 Microsoft Corporation
181
190
182
191
Licensed under the Apache License, Version 2.0 (the "License");
183
192
you may not use this file except in compliance with the License.
0 commit comments