Google Groups

Re: [backbonejs] How can I limit the size of a backbone collection?


Khurram Ijaz Mar 26, 2012 6:56 PM
Posted in group: backbonejs
it would be lot more easier to have it done on the server. but in case you had to do it after fetch then all i can think of is to create a new collection and assign to original after truncating.

On Tue, Mar 27, 2012 at 12:43 PM, Lowell Kirsh <low...@gmail.com> wrote:
I'm interested in setting a maximum size for a backbone collection. For instance, if after a fetch the collection is larger than maxSize, it should be truncated (e.g. remove eldest N entries). Is there an easy way to accomplish that?

Thanks,
Lowell

--
The Unofficial Backbone.js Group