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

How to call meteor method? #2

Open
gustawdaniel opened this issue Mar 27, 2020 · 1 comment
Open

How to call meteor method? #2

gustawdaniel opened this issue Mar 27, 2020 · 1 comment

Comments

@gustawdaniel
Copy link

gustawdaniel commented Mar 27, 2020

I was trying with this.api.call but without success.

I mean

this.api.call('hello')

works and call hello method, but I can't use arguments.

@gustawdaniel
Copy link
Author

I found that argument need to be array.

this.api.call('hello', ["message"])

Vue.prototype.$call = (method, ...args) => Vue.api.call(method, [...args])

Sources

https://github.com/oortcloud/node-ddp-client

https://medium.com/front-end-weekly/easily-connect-react-native-to-a-meteor-server-128dc3683041

If anyone want to use it like me you can add this line at the end of ddp.js plugin file

Vue.prototype.$call = function(method, ...args) { return this.api.call(method, [...args]) };

I hope this method will be added to this library in future.

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

1 participant