forked from spine/spine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add pull method to models for bulk ajax fetches
`.pull` is like `.fetch` with three differences: * it uses jquery's getJSON (bypassing the internal spine query queue) * it can pull one or multiple ids from a server * it has straightforward success/failure callback parameters Why all this? Firstly, I like to pull in records quickly when needed, so I think the internal queue is unecessary for quick gets. Think: youtube frontend (unlimited data with selective gets) instead of a tiny contact DB or calendar where pagination or fully loading the dataset makes sense. Secondly, I'd like to pull in one or multiple items at a time. If I set the pull id to 1,4,5,6,7 the server can parse the special id and return multiple results from one request. Alternatively, a list of multiple IDs can be passed in and they will be grabbed individually. Thirdly, simple callbacks make me happy. Attaching handlers to an extra options parameter feels like using YUI in 2006.
- Loading branch information
Showing
4 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters