Questions tagged [Reactive Extensions] (30)

0
answer

How does concatMap?

ConcatMap executes the threads one after another with ojidanii completion of the previous? And what outputs result from each thread or shared ultimately leading or the result from the last vypolnennogo flow. When can be useful?
Carli_Collier asked April 19th 20 at 12:47
1
answer

How to obtain a set of points on the coordinate plane?

I decided to get rid of the global variables and all data necessary for work functions and pass it through the parameters. For the problem of obtaining the set of points on the coordinate plane I wrote the following code: walls const$ = combineLatest( range(0, constants.wallsCnt), of(constants.canvasWidthPx), of(constants...
Elody_Willms asked April 19th 20 at 12:26
2
answers

How to change the value of the stream after the subscribe method?

Hello! I had not a regular job There is a timer, you need to add a button that will ostanavlivaetsa 300ms All it needs to be implemented using rxJS Can't understand how I can change the value of the subscription after clicking the button, you have to have orgogli, you still can't find niyitegeka If not difficult, I would ...
Imelda asked April 19th 20 at 11:52
1
answer

Is it possible to completely get rid of the global variables?

There's a 2D playing field, based on the html canvas. Using rxjs, I created two threads: 1 - to track keystrokes 2 - for storage of coordinates of a game object The problem is that out of the statement body map, in which the conversion of coordinates I have to access a global variable canvasWidthPx to the object on the lef...
Titus_Kertzmann91 asked April 18th 20 at 13:14
1
answer

Alternative form of entry combinaLatest has a rationale?

In rxjs, the operator combinaLatest can be written in two forms: const Game = combineLatest(StarStream, SpaceShip, Enemies, function(stars, spaceship, enemies) { return { stars, spaceship, enemies }; }).pipe( sample(interval(SPEED)) ) const Game = combineLatest(StarStream, SpaceShip, Enemies).pipe( map(v => { return...
Asha_Hilll28 asked April 18th 20 at 13:13
1
answer

How to fill out state?

I wrote a small game. In it field you can move the player's tank with the arrow keys. LIVE DEMO In state stores coordinates of the player. Also at state is the key walls, which stores the array of coordinates of the walls. Separately this array I generated in the flow walls$, but I can't add it to state. Please help. In ...
deron88 asked April 16th 20 at 10:30
2
answers

In rx.js to combine the streams so I can get the value of last and know what is a stream?

Here will and pushes each stream in turn. But I need the value [ null, null, EventMous, null ] - where value is the last value of the stream. From Merja I don't know what the stream gave a value but I learn from his order in the array. As with combineLatest but it gives the last value and I need null Example Stackblitz wit...
Braxton_Abshi asked April 9th 20 at 10:35
2
answers

Can I make requests through the loop in http.get — Angular?

The situation is, there is a list of people (for example I don't know their number), each page displays for 10 people and there is a link to the next page and so on until the last page, the last reference is null. How can I set condition that as long as the reference is not null to query, if null, then stop and output some...
June9 asked April 8th 20 at 02:44
0
answer

RX Java, how does combineLatest()?

Just started to learn Java RX, lectures from Yandex https://www.youtube.com/watch?v=3jdvLrYZfB4&t=1199s for 2016 there is an example (20:00) who made himself, but it works not, I have a condition from the option combineLatest() is always executed, while the code is essentially the same public class MainActivity extends ...
Estefania.Pouros asked April 7th 20 at 09:06
1
answer

Rxjava to load, save and display the image in a same conveyor?

The bottom line: you need to upload the image, save it and display. Everything works, but the current code I don't like: Single.fromCallable { call.execute() } .map { it.body?.byteStream() } .map { BitmapFactory.decodeStream(it) } .map {//I don't like it it.compress(Bitmap.CompressFormat.JPEG, 90, getOutPutStream()) it ...
Savanah asked April 4th 20 at 14:15