Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions aggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ const defaultOptions = ({
delay: 250,
lookupCollections: {},
clientCollection: collection._name,
noReady: false,
...options
});

export const ReactiveAggregate = function (subscription, collection, pipeline = [], options = {}) {
export default ReactiveAggregate = function (subscription, collection, pipeline = [], options = {}) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird, please use export default function ReactiveAggregate(...).

// fill out default options
const {
observeSelector, observeOptions, delay, lookupCollections, clientCollection
Expand Down Expand Up @@ -78,7 +79,7 @@ export const ReactiveAggregate = function (subscription, collection, pipeline =
// send an initial result set to the client
update();
// mark the subscription as ready
subscription.ready();
if (!options.noReady) subscription.ready();
// stop observing the cursor when the client unsubscribes
subscription.onStop(() => observerHandles.map((handle) => handle.stop()));

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: "jcbernack:reactive-aggregate",
version: "1.0.0",
version: "1.0.1",
// Brief, one-line summary of the package.
summary: "Reactively publish aggregations.",
// URL to the Git repository containing the source code for this package.
Expand Down