-
Notifications
You must be signed in to change notification settings - Fork 17
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
Could I check "is ready" to wait the result like pub/sub? #8
Comments
Interesting point - could you show me more code ? If you're using the PromiseHelper, I just pushed an update that lets you pass an additional loading text, in addition to the function to wrap. If that's not your use case, I'm not sure I can help - post some code and let's see though :)
|
// Server
Meteor.methods({
add: function () {
Meteor._sleepForMs(1000);
return 'Welcome to Promise Call';
}
// Client
<template name="myTpl">
{{#if myValue}}
{{myValue}}
{{else}}
{{> spinner}}
{{/if}}
Template.myTpl.helpers({
myValue: PromiseHelper(function(){
return Meteor.call('add');
})
})
</template> |
Could I use loading with |
I think you could do so like this: Blaze.toHTML(Template.spinner) Template.myTpl.helpers({
myValue: PromiseHelper(function(){
return Meteor.call('add');
}, Blaze.toHTML(Template.spinner))
}) Let me know if that works for you - I'm not sure if that functionality is something I'd take on internally, but I'd document it as a valid use case if it works! |
It don't work. It show |
Sorry, I could not reproduce this - if you have a more full example I'd love to see it. Thanks for all the great questions. |
I create the
Meteor.method()
to generate reports, so I want to show thespinner
or anyloading...
when the serve is running.Could I check "is ready" to wait the result like pub/sub?
Please example for me.
The text was updated successfully, but these errors were encountered: