knockout.mapping icon indicating copy to clipboard operation
knockout.mapping copied to clipboard

[Feature Request] Incremental update on observable arrays

Open vicary opened this issue 12 years ago • 4 comments

Regarding this post in Google Group, I am trying to build a web app this knockout mapping, but it requires working on a very large paged collection (observableArray).

Took a look on the debug code, and I came up with a few ways to implement this feature.

So I would like to know if the developers have a plan in mind for this, or we can discuss how should I contribute in a pull request.

vicary avatar Feb 03 '13 18:02 vicary

The plugin is designed to always take the full state from the server and map it to the state in javascript. If you want to work with subsets, you will have to design your model to split up the array or map only the smaller subsets.

sagacity avatar Feb 05 '13 11:02 sagacity

I can implement this upon current code of knockout.mapping, just dun know how the mapping syntax should be. How about adding an "increment" option in the mapping object?

vicary avatar Feb 06 '13 04:02 vicary

Hi, I have a fiddle that demonstrate a solution: http://jsfiddle.net/LHeQZ/45/

Best

rbraband avatar Apr 18 '13 08:04 rbraband

Nice approach, in fact I picked a similar way and simply made that as the default behaviour in .fromJS(). I don't thihk a full state is much needed whatsoever, people can .removeAll() by themselves if they mean so.

vicary avatar Apr 19 '13 05:04 vicary