New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API changes for easier lazy loading #467
Comments
I'd give it a more clear name than |
We could also overload Also: do we still need |
After sleeping on it for a night, I'm definitely leaning towards a separate method; how's I also think this function could straight up replace |
sounds good, +1 for not complicating Model#get |
I'd like to make some API changes to accommodate more transparent lazy loading. There's more than one option here, so feedback would be appreciated.
What I'm planning to do:
fetchRelated
to only return a single promise, which resolves when all requests are done (or a single one fails..)Model.lookup( attr )
method which acts likeModel.get
, but always return a promise which resolves with the attribute's value as its first argument. If the contents of the attribute/relation are found locally, it would resolve immediately; if not, it would resolve after the contents of the attribute/relation have been fetched.Any thoughts about this?
The text was updated successfully, but these errors were encountered: