What is the best way to implement sequencial http requests with optimistic concurrency in angular?

Julio Cachay

In this Angular app, the user fills inputs on a table, after each change, the app makes an http request to save changes, with each request, it sends a number which indicates the concurrency version. If the process is successful the server sends a response with the new version.

The problem comes when the user makes changes too fast, the post request will be sent before the previous response is received and therefore the concurrency number will not match.

I am new to angular, so, what is the best way to make a service that can send the requests one after another (one at a time) in a way that this allows me to save the concurrency version from a response to be used in the next request?

Thanks!

Manish Patidar

It's best to do it using rxjs, it gives you the best way to handle it.

You can follow this, and you can use the appropriate operators based on your needs and requirements.

By reading this blog, you'll gain a greater understanding of rxjs.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

What is the best way to use observables for http requests in angular?

Best way to implement trackable concurrency in Golang

What is the best way to implement swipe navigation with angular2 router?

What is the best way to implement a theme / template in meteor or angular-meteor

What is the best way to implement swipe navigation in Angular 2?

What is the best way to implement a "timer"?

Java best way to send multiple HTTP requests

What is an efficient way to handle inserts of unique "immutable" entities by multiple producers with optimistic concurrency approach?

In Electron , what is the best way to make ajax requests?

Angular - How to implement switchMap for multiple http requests?

What is the best way to implement user account activation?

What is the best way to implement google cloud storage?

What is the best way to implement my control

What is the best way to implement constants in Java?

What is the best way to implement a reordering method?

What is the best way to implement nested dictionaries?

OR and AND conditions not returning as expected - What is best way to implement it?

What's the best way to implement a semaphore in Go

What is the best way to implement "remember me" for a website?

What is the best way to implement translation for a PowerShell script?

What is the best way to implement facebook login on Android?

What is the best way to implement UITabbarcontroller with sidepanel?

What is the best way to implement this using Qt

What is the best way to implement double validation in Quasar?

What is the best way to implement a FIFO collection in mongoDB?

What is the best way to implement a component scoped singleton?

What's the best way to implement rubi in SVG

What is the best way to implement a DEMUX using VHDL?

What is the best professional way to detect the status of several ajax requests in Angular8?