Questions tagged [reactive-programming]

Reactive Programming is a programming paradigm oriented around data flows and the propagation of change.

Filter by
Sorted by
Tagged with
0 votes
1 answer
54 views

Awaited store for Svelte

In my Svelte app, I need to reactively fetch data from the server and then render the result. The ideal data struture for this is a store whose values are promises – eg. like this: ...
  • 286
1 vote
0 answers
25 views

Idiomatic API Authentication flow with ASWebAuthentication and Combine

I'm working on an app to display statistics based on user data from a third-party service's API. The authentication flow for the service's API that I wrote works, but some parts of it feel a bit ...
  • 297
1 vote
1 answer
131 views

Multithreaded observer pattern in Rust

I often want to program in an event driven way, but classic implementations of the observer pattern often pose an ownership challenge, and they only get more difficult once multiple threads are ...
  • 363
2 votes
1 answer
187 views

UIView position updates based on device motion via RxSwift

I've created a simple function to work as a level, where the dot on screen is centered when the device is completely flat. It changes position based on device orientation. I use RxSwift to update the ...
  • 101
0 votes
1 answer
362 views

Refactor multiple if condition in JavaScript/TypeScript

I want to refactor this code but am wondering how I should start it. I'm not sure this code is totally against clean code or not. I'm thinking to use RxJS or a JavaScript builtin method. I'd like to ...
  • 63
1 vote
2 answers
87 views

how to destructure this.props react js

I'm trying to create a component that receives an array, this component is going to show a list with props data ...
-2 votes
1 answer
289 views

How generate a random pojo value using reactor.core.publisher.Flux and reactor.util.function.Tuples [closed]

Firstly, take in account is my first question here in CodeReview. Any purpose misuderstanding will be highly appreciated if orientaded. Scenario: I want to answer randomly a pojo (json with two ...
  • 115
1 vote
0 answers
184 views

Setting the token for API client generated instances in an Angular application

I am developing an Angular application who also consumes an external REST API. I am also trying the OpenAPI generator using a TypeScript template. The OK path is the following: call a method that ...
  • 1,786
1 vote
0 answers
74 views

Pipe ResponseSpec's Body

I'm writing a utility method which pipes given ResponseSpec's body and gives to the caller a change to read it. ...
  • 133
1 vote
0 answers
81 views

Lightweight, modular Discord bot - tips and feedback on the code?

The full project is up on GitHub. The codebase is super small as it stands. I'm brand new to reactive programming and Spring, and would mostly like insight on those two things. Asynchronous ...
  • 111
5 votes
1 answer
46 views

Merging client names into orders using RxJS

I have an API which I can't modify. I have to use data as it is. I want to join data from two separate requests where the second request is based on data from the first one. I have a working ...
  • 151
2 votes
0 answers
762 views

Endless scroll in kotlin (android)

This is the code of my function to endless scrolling. It's a good practice to bind new disposable in onscroll listener? What do you think about my code? ...
7 votes
1 answer
5k views

Getting serial port list

Needed to get a local serial port list. System.IO.Ports.SerialPort.GetPortNames() returns names but not the descriptions like you can see in Device Manager: ...
  • 6,133
1 vote
2 answers
2k views

Observable implementation

I have implemented a simple Observable class. I think that there is still room for improvement. Especially the fact that I have separate array to observe results ...
  • 190
3 votes
0 answers
3k views

Implementation of reactive file write from InputStream

I want to implement reactive write to file. In low level, it uses NIO and Futures. After reading this section I created this code but maybe there's more clean or less code solution. Thanks. ...
2 votes
0 answers
1k views

Polling implemented using reactive framework (project reactor)

I have a use case where I need to poll a certain service till all data has arrived. The service accepts a list of ids and responds with data corresponding to these ids. Data is asynchronously made ...
  • 415
3 votes
0 answers
150 views

React.JS functional paradigm

I have some (minimal) experience with the functional programming paradigm and I'm new to React.js and reactive programming. I'm trying to get a flavour for the React.js philosophy and I keep seeing ...
  • 131
4 votes
1 answer
314 views

Notify user of credential failure and make another attempt

The below code works because of the do operator on line 24. Is there a more functional way to get the test to pass, or would you consider this an appropriate use of ...
  • 771
1 vote
0 answers
2k views

Paging loader using RxSwift

This is generic logic for handling network requests that load data based on pages. It is assumed that the view controller would implement the UISource protocol. I ...
  • 771
3 votes
1 answer
6k views

Is my implementation of a simple CRUD service with Spring WebFlux correct?

I am implementing a simple Movie based CRUD API using Spring WebFlux and Reactive Spring Data MongoDB. I want to make sure that my implementation is correct and that I am properly using Flux and Mono ...
1 vote
1 answer
685 views

Line count of each file in a given directory efficiently using akka

This is my first program in akka so I wanted to know if the program is efficient and is using the advantages of actor model. The program's purpose is to scan a given directory for any files and print ...
  • 111
1 vote
0 answers
67 views

REST request using reactive programming

The following code is an extract of a small library I wrote. Full code is available here. My question is about the following function. I added comments on each state. I'm wondering if I could do ...
  • 183
2 votes
1 answer
83 views

ReactiveX observable that uses another observable

I am trying to write an Angular service that will wrap the regular Http service and automatically make authentication calls if Bearer token is not available or invalid. Here's an illustration of a ...
5 votes
1 answer
159 views

Video downloader app implemented in RxJs

I have used multiple map/flatmap combinations. Could anybody help me with the review? ...
5 votes
1 answer
2k views

Reactive Properties for easy property binding

This is my attempt to write a data-bindable, platform independent property that doesn't require any literal strings. The basic idea is to basically have the same functionality as IObservable, but with ...
  • 645
2 votes
1 answer
5k views

ReactiveUI And WPF - Reusing a value to update multiple properties

I've created my first ReactiveUI app in WPF. Simply, the user enters their full name in one textbox, and then the name gets split into its parts and displayed in the other textboxes. This is just an ...
2 votes
1 answer
64 views

Preforming some async operations with Rx.js

I tried to come up with a good challenge to learn some Rx.js programming and I came up with this chain of operations below. As well as a bit of code that works and does these things. Take github ...
4 votes
3 answers
541 views

Performing data transportations in RxJS with Promises

I'm using RxJS 5.0.0-alpha.12 to perform some data transformations, and some of those transformations use Promises. ...