meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
574 stars 159 forks source link

Idea: hooks for Meteor.call #411

Open ivklgn opened 3 months ago

ivklgn commented 3 months ago

any ideas for Meteor.callAsync and react hooks?

StorytellerCZ commented 2 months ago

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 commented 2 months ago

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?