Skip to content
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

Idea: hooks for Meteor.call #411

Open
ivklgn opened this issue Aug 15, 2024 · 3 comments
Open

Idea: hooks for Meteor.call #411

ivklgn opened this issue Aug 15, 2024 · 3 comments

Comments

@ivklgn
Copy link

ivklgn commented Aug 15, 2024

any ideas for Meteor.callAsync and react hooks?

@StorytellerCZ
Copy link
Collaborator

What are you thinking about? What would be the benefit and how would it look like?

Maybe something like this:

const [result, error] = useCallAsync('method.name', param1, param2, ...)

The problem with this one is that the method would get called immediately or are we looking for different options along the lines of Apollo Mutations?
https://www.apollographql.com/docs/react/data/mutations

@ivklgn
Copy link
Author

ivklgn commented Sep 19, 2024

yes, something like that
we can make 2 hooks

but for calls - only one lazy will better!


one more question about type inference for method name and args. do you have ideas about that?

@StorytellerCZ
Copy link
Collaborator

Now that React 19 is out we should look at the new hooks and see what we can adapt for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants