Reputation: 14850
Spine.js takes the stance that all data should be loaded upon first request and operated on from within the browser as to avoid blocking the UI. I totally agree. But... what if I want to load all of the data for a single month. Not ALL of the data which might be years worth of data as would be prescribed, but just a single month's worth.
The items I am loading have date which is used to group them for individual days so assume that grouping and all of that is already handled. I'm more interested in how this should be structured in Spine.
The big idea is that data would be loaded on a path like 'data/2011/12' and navigating to 'data/2012/01' would load that months data and display it asynchronously since they may or may not ever navigate to the next month.
Upvotes: 1
Views: 227
Reputation: 984
In your situation, I would preload some of the data - then load more data in when they advance per month. You can do this by giving 'fetch()' some query parameters. Cache the data, so if they precede to a month they've already viewed, it'll work instantly.
Upvotes: 1