JackAdams / meteor-transactions

App level transactions for Meteor + Mongo
http://transactions.taonova.com/
MIT License
113 stars 16 forks source link

Page re-renders when using the transaction for updates #94

Open maitrid opened 7 years ago

maitrid commented 7 years ago

In an app using Meteor + React that updates couple of documents after the user submits a form, under normal circumstances, only the relevant component updates, but after implementing tx.start, and tx.commit around the data update calls, the whole page re-renders after form submit. Is there anything that can prevent the whole page re-rendering?

JackAdams commented 7 years ago

Ah... yes. The transactions package writes to top-level fields on the document:transaction_id (always) and, for soft deletes only, deleted.

I'm guessing you're editing a field in a sub-document, which means that whole re-render doesn't normally need to happen. Is that the case?

maitrid commented 7 years ago

Yes, that's exactly what i'm doing. Thanks!