Open chadokruse opened 10 years ago
I think this is a good idea. @cmather - what do you think?
Possibly the right approach (at least to begin with) is to make a package for this. That way we can let the API for it mature without affecting IR in the meantime.
Yeah let's play around. I would start with the refactor branch. You could do something like this:
Router.plugin('loading', {
loadingTemplates: {
....
}
});
Iron.Router.plugins.loading = function (router, options) {
Router.onBeforeAction(function () {
var templates = this.lookupOption('loadingTemplates');
...
}, options);
};
Any progress on this?
Similar to yieldTemplate, but for loadingTemplate.
E.g. this:
can be expanded to this:
Would allow for the use of "optimistic rendering" similar to what Facebook does with its main news feed. With complex layouts I could show one template "dummy" for one nested template, and another "dummy" for another nested template under the same
{{> yield}}
. See discussion here.On a more simplistic level, it would allow for targeting spinners to just the nested templates involving data, as discussed in this SO question.