Questions tagged [reactive-extensions-js]

The Reactive Extensions for JavaScript is a set of libraries to compose asynchronous, resilient and responsive event driven programs using observable collections with ECMA Script5 Array#extras style composition in JavaScript.

121 questions
10
votes
2 answers

Idiomatic way to recover from stream onError

Disclaimer: it is the continuation for the previous Safe update for 2 dependent streams question What is the idiomatic way to handle errors in RxJS (or any other RX implementation) that allows the stream to not terminate? Relevant code is function…
zerkms
  • 249,484
  • 69
  • 436
  • 539
10
votes
0 answers

Can't find assembly - System.Reactive.Debugger

I have installed visual studio 2010 express and then Reactive Extensions 2.0. When I start my app in debug mode, part of code where reactive extensions is used following exception is thrown: The assembly with display name…
user1639633
  • 101
  • 3
9
votes
1 answer

RxJS: Recursive list of observables and single observer

I've been having some trouble with a recursive chain of observables. I am working with RxJS, which is currently in version 1.0.10621, and contains most basic Rx functionality, in conjunction with Rx for jQuery. Let me introduce an example scenario…
derabbink
  • 2,419
  • 1
  • 22
  • 47
9
votes
3 answers

RxJS reduce doesn't continue

Why doesn't the flatMap cause downstream reductions to fire? I got code like: handleFiles.flatMap(files => Rx.Observable.from(files). flatMap((file, i) => fileReader(file, i)). reduce((form, file, i) => { form.append('file[' + i + ']',…
Henrik
  • 9,714
  • 5
  • 53
  • 87
9
votes
7 answers

How to load images async with RxJs and perform a method when all loaded

I am trying to convert my promise based code to RxJs but have a hard time to get my head around Rx especially RxJs. I have a an array with paths. var paths = ["imagePath1","imagePath2"]; And I like to load images in Javascript var img = new…
silverfighter
  • 6,762
  • 10
  • 46
  • 73
9
votes
4 answers

Turning paginated requests into an Observable stream with RxJs

I have a service which returns data in pages. The response to one page contains details on how to query for the next page. My approach is to return the response data and then immediately concat a deferred call to the same observable sequence if…
RichB
  • 520
  • 5
  • 10
8
votes
3 answers

How to detect konami code with Rx.js (reactive extensions for javascript)?

I want to start learning Rx.js and I'm looking for a cool example to start the ball rolling. How do I detect konami code with Rx.js? I want to detect a sequence of key press events (up up down down left right left right B A) and display an image if…
Endy Tjahjono
  • 24,120
  • 23
  • 83
  • 123
8
votes
1 answer

RxJS - Loading indicator

I'm struggling to get my head around the "Rx" way of displaying a loading indicator for an AJAX stream. $scope.$createObservableFunction("load") .take(1) .do(function(){ $scope.loading = true; }) …
MaxWillmott
  • 2,170
  • 2
  • 23
  • 34
7
votes
1 answer

Reactive Extensions for Javascript code examples

Microsoft have published Reactive Extensions for Javascript. It should make asynchronous (and event based) web-ui programming easy. There are currently a video and some tutorials. But how cool UI could I really make? Do you know any good demos or…
Tuomas Hietanen
  • 4,650
  • 2
  • 35
  • 43
7
votes
1 answer

how to avoid glitches in Rx

Unlike other "FRP" libraries, Rx doesn't prevent glitches: callbacks invoked with time-mismatched data. Is there a good way to work around this? As an example, imagine that we have a series of expensive computations derived from a single stream…
6
votes
1 answer

How do I update/add items in/to an IObservable dynamically?

I have an observable collection to which I want to keep feeding objects and they should reach observers even after someone has subscribed to it (which ofcourse is the main aim of an observable). How do I do it? In the following program, after the…
P.K
  • 18,587
  • 11
  • 45
  • 51
6
votes
4 answers

combineAll does not emit on empty array

JSBIN Sample I have a changeable set of child components (POJO object) that each have its own state stream. Each time a user triggers addChild/removeChild/clearChildren, a new set of children state streams is emitted with #switchMap. So far so good!…
Marcus Rådell
  • 622
  • 7
  • 12
6
votes
3 answers

RxJS: Producer-consumer with abort

I've got a special producer consumer problem in RxJS: The producer slowly produces elements. A consumer is requesting elements and often has to wait for the producer. This can be achieved by zipping the producer and the request stream: var produce =…
maiermic
  • 4,764
  • 6
  • 38
  • 77
6
votes
3 answers

How to define cycles with observables

I'm trying to set up the update loop of a simple game, built with observables in mind. The top-level components are a model, which takes input commands, and produces updates; and a view, which displays the received updates, and produces input. In…
pkt
  • 1,808
  • 1
  • 12
  • 16
6
votes
1 answer

Synchronicity in RxJS

I would expect that the following code would run asynchronously: var range = Rx.Observable.range(0, 3000000); range.subscribe( function(x) {}, function(err) {}, function() { console.log('Completed'); }); console.log('Hello World'); But…
1
2
3
8 9