Coder Social home page Coder Social logo

Comments (7)

exAspArk avatar exAspArk commented on July 21, 2024 1

Thank you for opening the issue!

call is pretty generic

Yes, I agree. On the other hand, match_id is too specific and assumes that the first argument is some kind of ID, which not always the case.

In general, loader is just a "function" (lambda). That is why it is executed by using the standard Ruby load method. Renaming it will require changing the data structure. And at the same time, I'd like to avoid making breaking changes, so we'd need to keep the compatibility with load. But if you come up with some better names, feel free to share :)

from batch-loader.

davidw avatar davidw commented on July 21, 2024

How about...

  • lookup.call
  • matcher.call
  • connector.call

I could also imagine something fancier like set_target(target).from(source) although I don't know how you'd get that working, not knowing the internals of all this!

from batch-loader.

 avatar commented on July 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

from batch-loader.

davidw avatar davidw commented on July 21, 2024

Still interested.

from batch-loader.

 avatar commented on July 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

from batch-loader.

davidw avatar davidw commented on July 21, 2024

Still interested

from batch-loader.

exAspArk avatar exAspArk commented on July 21, 2024

Thanks for your feedback!

  • lookup.call
  • matcher.call
  • connector.call

I think you can easily use any of the suggested names in your code since loader is just the name of a local variable with a lambda:

BatchLoader::GraphQL.for_id(post.user_id).batch do |user_ids, connector|
  User.where(id: user_ids).each { |user| connector.load(user.id, user) }
end

I wouldn't go with anything fancier to keep it simple for now since it will require creating a more complicated loader object vs simple lambda. Maybe in the future :)

I am going to close the issue.

from batch-loader.

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.