aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 138 forks source link

ReactiveTable.publish and disableOplog #418

Open meteorza opened 8 years ago

meteorza commented 8 years ago

Is there a way to use Meteor's disableOplog: true on a collection when using a ReactiveTable.publish? This will disable oplog-tailing on a collection query.

The goal is to temporarily pause/disable reactivity to the table.

I see there is a disablePageCountReactivity feature. So what I am looking for is a similar feature disableAllPublishReactivity for example.

So on the client side I can have On/Off switch which allows subscription to the Reactive Publish OR Non-Reactive Publish.

Is this possible?

aslagle commented 8 years ago

I added a new disableRowReactivity option, so that you could set both disableRowReactivity and disablePageCountReactivity to disable all reactivity.

I'll publish a new version once I can get my tests to run. The meteor tool updated itself and I'm getting a node-gyp error when I run meteor test-packages that I can't figure out how to fix.

It's on a branch called disable-row-reactivity if you want to try it from there in the meantime.

Also, I could add a separate option for disableOplog, but I don't understand it well enough to know if there are cases when it would help - the docs say it changes the way observe works, and observe doesn't get called at all if you set the other two options.

aslagle commented 8 years ago

Also, I made this a server-side option. For your client-side on/off switch, you'd need to call ReactiveTable.publish twice on the server, once with the disable options true and once with them false, and give the publications different names. Then switch which name you use on the client when you want to toggle reactivity.

aslagle commented 8 years ago

Okay, I published it in version 0.8.34. I couldn't fix the node-gyp error, but I got an older version of the meteor tool to run by moving my package code into an app on an older version.

meteorza commented 8 years ago

Thank you, Will test as well and will let you know if there are any problems.

meteorza commented 8 years ago

Thank you, works well.