开发者

Collection usage in BackboneJS

开发者 https://www.devze.com 2023-04-08 14:40 出处:网络
Which is better to use the collection: Collection contain the total list of data, and include a function to select the the part of data show in view. Lots of data should be loaded in client side.

Which is better to use the collection:

  1. Collection contain the total list of data, and include a function to select the the part of data show in view. Lots of data should be loaded in client side.

  2. Collection only 开发者_高级运维contain the data to show in view. In this way, require to fetch data from server more frequently. And the data to show in view is selected on server side.

Any suggestion?


It depends on the size and sensitivity of the collection, but in general I preference proxying requests to the server-side, and storing only the view/cache data locally. It will serve better in the long-run.


If you have tonnes of data, best solution will be to load it on demand.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号