-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding methods and property to manually control write transactions #1216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are available to RN as well, so we need to add the equivalent proxies in /lib/browser/index.js
Otherwise, looks good!
lib/index.d.ts
Outdated
@@ -452,6 +453,21 @@ declare class Realm { | |||
* @returns void | |||
*/ | |||
write(callback: () => void): void; | |||
|
|||
/** | |||
* @returns void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the comments from the documentation .js file here as well -- hopefully at some point, this file can be the single source of documentation both for the website and for typescript-aware ide's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it better do redo/unite the documentation in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this applies to other methods than just this one, then yes. I didn't check for that. :-)
@kristiandupont @blagoev I have been through the PR feedback, and I believe it is ready to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good with the latest changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I would suggest dropping the is
prefix on the property - we don't use it for boolean properties in JavaScript.
What, How & Why?
Write transactions are currently only done through the
Realm.write()
function. Sometimes it is useful to be able to control the write transactions manually. This PR adds a set of methods.See also #715, #815, and #1188.
☑️ ToDos
Breaking
label has been applied or is not necessaryIf this PR adds or changes public API's: