Comments (6)
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 :)
Template.foo.helpers({
report: PromiseHelper(function(){ return Meteor.call(method, args); }, "loading...")
});
from meteor-promise.
// 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>
from meteor-promise.
Could I use loading with spinner
template?
PromiseHelper(function(){ return Meteor.call(method, args); }, Template.spinner)
from meteor-promise.
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!
from meteor-promise.
It don't work. It show [object object]
.
from meteor-promise.
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.
from meteor-promise.
Related Issues (20)
- Problem with "loanding" text, when get data from collection on Meteor.methods()? HOT 2
- Could I return array form Meteor.methods()? HOT 1
- Replacing to okgrow:promise should we update our current promisses? HOT 7
- Promise.all like for Meteor.subscribe - #readyPromise() HOT 5
- Provide HTTP.callPromise on the server? HOT 4
- okgrow vs deanius meteor-promise? HOT 2
- Feature request: Meteor.applyPromise HOT 1
- Support for IE8 ? HOT 1
- Getting "TypeError: Object [object Object] has no method 'callPromise'" HOT 5
- Wrap the collection methods (insert,update,elete)?
- Getting errors running tests in Meteor 1.3-rc.2 HOT 3
- Demo / Docs Is Down HOT 4
- Test
- cosmos:browserify dependency HOT 3
- Omits query fields in data-loading method HOT 1
- not compatable with Meteor 1.6
- DevTools failed to parse SourceMap
- publish latest? HOT 1
- This package is still maintenance?
- How to Synchronous call on the Server (return result)?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-promise.