Giter VIP home page Giter VIP logo

Comments (2)

PaulUithol avatar PaulUithol commented on September 6, 2024

Yes, it should; but it does determine which objects to fetch based on the id's that you currently have specified in the relation. For an example, you could take a look at the tests for HasOne and HasMany.

from backbone-relational.

wulftone avatar wulftone commented on September 6, 2024

Ah, I think I understand the purpose of this function now. It's for fetching known related records that you just haven't loaded into Backbone yet. I kinda figured I would use it to fetch only newly added records for a set, but you need to know the ids of those records first.... so fetch really is what I needed.

That does beg the question of loading records from the database that you don't have on the client side, though... so you could send all of the ids for the Backbonified records to the server, make a routine to send back the missing relations, and turn them into Backbone objects when you get the response... Hmm.

For example, I have a Post with comments 1, 2 and 3, but comments 4 and 5 happen after I've loaded my initial Backbone object... when I navigate to see the comments, it could perform the routine above--sending the server comment ids 1, 2, and 3, and bring back only comments 4 and 5 to add to my collection.

Seems useful, but maybe overkill when a normal fetch() might be just as fast?... unless we're talking about hundreds of comments or something.

from backbone-relational.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.