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

Improve documentation for Memory store #196

Closed
wants to merge 3 commits into from

Conversation

msssk
Copy link
Contributor

@msssk msssk commented Aug 31, 2016

  • document sync methods in a table
  • explain when to use sync methods
  • document setData method

Stores.md: Memory store:
* add documentation of 'setData'
* improve organization of sync method docs
Stores that can perform synchronous operations may provide analogous methods for `get`, `put`, `add`, and `remove` that end with `Sync` to provide synchronous support. For example `getSync(id)` will directly return an object instead of a promise. The `dstore/Memory` store provides `Sync` methods in addition to the promise-based methods. This behavior has been separated into distinct methods to provide consistent return types.

It is generally advisable to always use the synchronous methods so that client code does not have to be updated in case the store is changed. However, if you have very performance intensive store accesses, the synchronous methods can be used to avoid the minor overhead imposed by promises.
Copy link

@dylans dylans Aug 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant asynchronous on the first part of line 35, "It is generally advisable to always use the synchronous methods so that"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! A very important distinction, fixed it!

@edhager edhager closed this in ffb8550 Sep 28, 2016
@edhager
Copy link
Member

edhager commented Sep 28, 2016

Thanks @msssk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants