3 replies
May '16

rdagger

ESLint is throwing meteor/audit-argument-checks “is not checked” when I use SimpleSchema to validate the arguments to the publication. Is there a way to have ESLint recognize that SimpleSchema is indeed checking the values?

Here’s my code:

/* eslint-disable prefer-arrow-callback */
import { Meteor } from 'meteor/meteor';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { Comments } from '../comments';

Meteor.publish('comments', function(limit, projectId) {
  new SimpleSchema({
    limit: { type: Number },
    projectId: { type: String },
  }).validate({ limit, projectId });
  return Comments.find({ projectId }, { limit: limit || 10, sort: { createdAt: -1 } });
});
Apr '17

oliverlloyd

For anyone trying to figure out the low level API, Matt Debergalis posted a really nice explanation on SO that makes it very simple to reason out.

Jun '17

haojia321

Have a question regarding publish Meteor.publish(‘todos.inList’, function(listId, limit)
So, say I call it twice, first time limit is 100 and second time limit is 200. Will server really query 200 items for the second time? If yes, wouldn’t it cause performance issue?