Skip to content
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

Merged
merged 5 commits into from
Aug 21, 2017

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Aug 15, 2017

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

  • 📝 Changelog entry
  • 🚦 Tests
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

@kneth kneth requested a review from kristiandupont August 15, 2017 15:48
@kneth kneth added the S:Review label Aug 15, 2017
@kneth kneth requested a review from blagoev August 15, 2017 15:48
Copy link
Contributor

@kristiandupont kristiandupont left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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. :-)

@blagoev blagoev mentioned this pull request Aug 16, 2017
@kneth
Copy link
Contributor Author

kneth commented Aug 18, 2017

@kristiandupont @blagoev I have been through the PR feedback, and I believe it is ready to be merged.

Copy link
Contributor

@blagoev blagoev left a 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

Copy link
Member

@fealebenpae fealebenpae left a 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.

@kneth kneth merged commit 85fb49b into master Aug 21, 2017
@kneth kneth deleted the kneth/manual-transactions branch August 21, 2017 15:49
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants