Skip to content

Commit

Permalink
Small updates, add default functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kolyasya committed Dec 23, 2020
1 parent 25945ea commit 1b05994
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion example/imports/ui/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const Table = ({
progressPending={postsLoading}
pagination
paginationServer
paginationTotalRows={totalRows}
selectableRows
paginationTotalRows={totalRows}
onChangeRowsPerPage={onChangeRowsPerPage}
onChangePage={onChangePage}
onSort={onSort}
Expand Down
9 changes: 5 additions & 4 deletions example/packages/meteor-pagination/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;

Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions example/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ publishPaginated({
name: 'posts.paginated',
customCollectionName: 'posts.paginated',
countsCollectionName: 'posts.paginated.count',
getOptions: (options) => options,
getSelector: (selector) => selector,
});

0 comments on commit 1b05994

Please sign in to comment.