meteor

How do I set Meteor to not cache anything for a specific page?

≡放荡痞女 提交于 2020-01-13 06:32:18
问题 I am working on a project where I am using Meteor as an implementation. There are set of pages that are being cached and there's no concern. However, there is one page in the project that I am trying to set for no-cache. How do I achieve that? EDITED: Based on chosen accepted answer; I achieved the desired result with this wrapping code: if (Meteor.isServer) { Meteor.startup(function () { WebApp.rawConnectHandlers.use(function (req, res, next) { res.setHeader('cache-control', 'no-cache'); res

How do I set Meteor to not cache anything for a specific page?

假装没事ソ 提交于 2020-01-13 06:32:07
问题 I am working on a project where I am using Meteor as an implementation. There are set of pages that are being cached and there's no concern. However, there is one page in the project that I am trying to set for no-cache. How do I achieve that? EDITED: Based on chosen accepted answer; I achieved the desired result with this wrapping code: if (Meteor.isServer) { Meteor.startup(function () { WebApp.rawConnectHandlers.use(function (req, res, next) { res.setHeader('cache-control', 'no-cache'); res

Meteor template reload infinity

孤者浪人 提交于 2020-01-12 20:17:30
问题 I have a problem when running with Meteor. I have a "question" page which I want to increase the count view whenever it is rendered. So in my template function I write Template.questionview.helpers({ question : function() { if(Session.equals('main_template_name', 'question')) { console.log(Session.get('question_id')); Questions.update({ _id: Session.get('question_id') }, { $inc: { views: 1 } }); } }); Now here comes the problem, when I render the question view and update the question item,

Render multiple components in React Router

倖福魔咒の 提交于 2020-01-12 07:52:06
问题 I'm used to application layouts with multiple yield areas, i.e. for content area and for top bar title. I'd like to achieve something similar in React Router. For example: <Router> <Route path="/" component = { AppLayout }> <Route path="list" component = { ListView } topBarComponent = { ListTopBar }/> </Route> </Router> AppLayout: <div className="appLayout box"> <div className="appLayout topBar"> { -- display ListTopBar here -- } </div> <div className="appLayout content"> { -- display

Remove inserted template in meteor 0.8.0

非 Y 不嫁゛ 提交于 2020-01-12 07:42:08
问题 I am inserting templates using UI.render() and UI.insert(). When I tried to remove the template I inserted, it seems to stay in memory and the destroyed method is not called. According to the documentation, it should clean up property if I use jquery to remove the element. I'm testing it using the following code: test.html: <head> <title>removeTest</title> <style> #content { height: 500px; width: 500px; background-color: gray; } </style> </head> <body><div id="content"></div></body> <template

Meteor rendered callback and applying jQuery Plugins

妖精的绣舞 提交于 2020-01-12 07:14:48
问题 Looking for a pattern when applying a jQuery plugin -- like a slider or isotope -- to a collection of DOM elements that are loaded with dynamic content from Meteor. If you call the template.rendered (doc here) seems like a logical choice. When the template is rendered apply the jQuery. According to the Blaze wiki template.rendered is now only called once. Sounds good. However it doesn't mentioned that template.rendered is called before the contents of the template are applied to the DOM. So

Meteor rendered callback and applying jQuery Plugins

孤街浪徒 提交于 2020-01-12 07:13:27
问题 Looking for a pattern when applying a jQuery plugin -- like a slider or isotope -- to a collection of DOM elements that are loaded with dynamic content from Meteor. If you call the template.rendered (doc here) seems like a logical choice. When the template is rendered apply the jQuery. According to the Blaze wiki template.rendered is now only called once. Sounds good. However it doesn't mentioned that template.rendered is called before the contents of the template are applied to the DOM. So

Meteor rendered callback and applying jQuery Plugins

陌路散爱 提交于 2020-01-12 07:13:07
问题 Looking for a pattern when applying a jQuery plugin -- like a slider or isotope -- to a collection of DOM elements that are loaded with dynamic content from Meteor. If you call the template.rendered (doc here) seems like a logical choice. When the template is rendered apply the jQuery. According to the Blaze wiki template.rendered is now only called once. Sounds good. However it doesn't mentioned that template.rendered is called before the contents of the template are applied to the DOM. So

Why does Meteor use fibers rather than promises or async or something else?

时间秒杀一切 提交于 2020-01-12 04:17:39
问题 Why does Meteor use fibers rather than promises or async or maybe left asynchronous calls? What are the fibers benefits? Can someone explain that architectural decision? 回答1: Straight from the horse's mouth, lead Meteor developer Geoff Schmidt: Meteor is focused on giving the best possible experience to the application developer . We've had to make some seemingly unpopular or risky decisions to get there, but that has resulted in a set of tools that are simpler, more powerful, and more fun to

Return value from recurring function

有些话、适合烂在心里 提交于 2020-01-11 13:13:46
问题 This Meteor server recursive method commonHint returns result undefined to the console even the finalRes has a value. Any suggestion on how to return the finalRes to the caller? thx //call the recursive method let result = this.commonHint(myCollection.findOne({age: 44}), shortMatches); console.log('got most common hint: ' + result); // <=== undefined ==== 'commonHint': function (doc, shortMatches, hinters, results = []) { // first call only first 2 args are defined, if (!hinters) { hinters =