Originally created by @mitchclay on GitHub (Jan 13, 2017).
I don't see any examples and don't see anything in the documentation about how to discard changes. Like I have an object that I use to fill out a form of a screen, I will assign some of the entered data that could be further modified on another screen but then the user selects a Cancel button, it should discard the changes and pull the original object from the persistent store.
How do I do that with this?
Originally created by @mitchclay on GitHub (Jan 13, 2017).
I don't see any examples and don't see anything in the documentation about how to discard changes. Like I have an object that I use to fill out a form of a screen, I will assign some of the entered data that could be further modified on another screen but then the user selects a Cancel button, it should discard the changes and pull the original object from the persistent store.
How do I do that with this?
adam
added the question label 2025-12-29 15:24:54 +01:00
Hi, when you call commit() on any transaction, your changes will be saved and unless you have other flagging mechanisms in your app those changes cannot be discarded. If you want to hold temporary changes before committing them, you can use the dataStack.beginUnsafe() transaction variant, which creates a transaction that can freely make changes and make commits on any queue.
@JohnEstropia commented on GitHub (Jan 17, 2017):
Hi, when you call `commit()` on any transaction, your changes will be saved and unless you have other flagging mechanisms in your app those changes cannot be `discarded`. If you want to hold temporary changes before committing them, you can use the `dataStack.beginUnsafe()` transaction variant, which creates a transaction that can freely make changes and make commits on any queue.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @mitchclay on GitHub (Jan 13, 2017).
I don't see any examples and don't see anything in the documentation about how to discard changes. Like I have an object that I use to fill out a form of a screen, I will assign some of the entered data that could be further modified on another screen but then the user selects a Cancel button, it should discard the changes and pull the original object from the persistent store.
How do I do that with this?
@JohnEstropia commented on GitHub (Jan 17, 2017):
Hi, when you call
commit()on any transaction, your changes will be saved and unless you have other flagging mechanisms in your app those changes cannot bediscarded. If you want to hold temporary changes before committing them, you can use thedataStack.beginUnsafe()transaction variant, which creates a transaction that can freely make changes and make commits on any queue.