Comments (2)
Thinking about it a bit longer, I guess one solution would be to make sure that save
doesn't do simultaneous requests, and queue the last one up until the current one is finished.
from ampersand-model.
You need to decide what your request strategy is:
- parallel
- race
- sequential
What you are doing is a race, and it has it's benefits, if that's what you want to do.
sequential saves are easy to do, just chain the promises (or success callbacks).
parallel saves are impossible to do on PUT requests, only on PATCH, assuming you are modifying the entire model.
Other than that, I don't see a solution to this ending up in this repository, perhaps in a different one, as to keep this about core functions. Most users don't deal with these edge cases..
from ampersand-model.
Related Issues (20)
- Automatically setting collection and collection items parent for models initialized from JSON HOT 3
- success handlers dont get access to the actual http response
- Relative urlRoot
- wrapError stripping ampersand-sync's err.message. HOT 3
- When wait: true, serialization not applied to attributes passed to the save method. HOT 8
- Save options wait:true and patch:true are mutually exclusive HOT 4
- Use ampersand-sync 3.0.7 HOT 1
- Evaluate changes in ampersand-sync 4.0
- Adopt ampersand-sync v4.0
- A collection declared as a prop introduces errors. HOT 2
- Props array type doesn't update until after .save() HOT 3
- model.destroy() returning opts.success() with no DELETE xhr created HOT 3
- When using ampersand-model I cannot save a prop called `url` HOT 3
- Mixing in data for every request HOT 1
- local data HOT 4
- update ampersand-sync to 4.0.3
- Error when using latest ampersand-state HOT 2
- Incompatibility with Webpack?
- Missing attributes from server are not removed HOT 3
- Default content type to text/plain;charset=UTF-8 with ajaxConfig HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ampersand-model.