From 1b05994cf5147f924a1e4194d1c06a480322ee30 Mon Sep 17 00:00:00 2001 From: Nikolay Aleshkovskiy Date: Wed, 23 Dec 2020 23:59:32 +0300 Subject: [PATCH] Small updates, add default functions --- example/imports/ui/Table.jsx | 2 +- example/packages/meteor-pagination/server.js | 9 +++++---- example/server/main.js | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/example/imports/ui/Table.jsx b/example/imports/ui/Table.jsx index bf2af0e..962a549 100644 --- a/example/imports/ui/Table.jsx +++ b/example/imports/ui/Table.jsx @@ -67,8 +67,8 @@ const Table = ({ progressPending={postsLoading} pagination paginationServer - paginationTotalRows={totalRows} selectableRows + paginationTotalRows={totalRows} onChangeRowsPerPage={onChangeRowsPerPage} onChangePage={onChangePage} onSort={onSort} diff --git a/example/packages/meteor-pagination/server.js b/example/packages/meteor-pagination/server.js index 7db6d76..0b300b4 100644 --- a/example/packages/meteor-pagination/server.js +++ b/example/packages/meteor-pagination/server.js @@ -6,8 +6,9 @@ export function publishPaginated({ customCollectionName, countsCollectionName, getAdditionalFields, - getSelector, - getOptions, + // Default functions may be overwritten + getSelector = selector => selector, + getOptions = options => options, }) { return Meteor.publish(name, function (params) { const { @@ -31,6 +32,8 @@ export function publishPaginated({ if (sort) options.sort = sort; if (skip) options.skip = skip; if (fields) options.fields = fields; + + // ??? if (transform) options.transform = transform; if (typeof reactive !== 'undefined') options.reactive = reactive; @@ -40,8 +43,6 @@ export function publishPaginated({ const countsName = countsCollectionName || name + '.count'; - console.log(options); - publishCount(this, countsName, collection.find(selector, { ...options, limit: 0, fields: { _id: 1 } })); // observe callback function diff --git a/example/server/main.js b/example/server/main.js index 8f285bb..c9d103a 100644 --- a/example/server/main.js +++ b/example/server/main.js @@ -8,6 +8,4 @@ publishPaginated({ name: 'posts.paginated', customCollectionName: 'posts.paginated', countsCollectionName: 'posts.paginated.count', - getOptions: (options) => options, - getSelector: (selector) => selector, }); \ No newline at end of file