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

Documentation: Document missing methods for data module #7015

Closed
gziolo opened this issue May 30, 2018 · 1 comment
Closed

Documentation: Document missing methods for data module #7015

gziolo opened this issue May 30, 2018 · 1 comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Developer Documentation Documentation for developers

Comments

@gziolo
Copy link
Member

gziolo commented May 30, 2018

When working on publishing data module to npm, we noticed that some methods aren't documented in the README file:

  • setPersistenceStorage
  • withRehydration
  • loadAndPersist

We should fix it. In addition, we should add a note how to use them in node environment because by default they depend on window.localStorage. Example of how to setup it with store npm module:

import store from 'store';

setPersistenceStorage( store );

I haven't tested it, but in general, it should work as explained by @aduth:

So we default to a broken (error-throwing) state for Node environments where this package is used?

It's probably a larger dependency than we'd want, but something like Store.js is a good abstraction for this sort of thing.

@gziolo gziolo added [Type] Developer Documentation Documentation for developers Good First Issue An issue that's suitable for someone looking to contribute for the first time labels May 30, 2018
@gziolo gziolo added this to the Merge Proposal: Documentation milestone May 30, 2018
@aduth
Copy link
Member

aduth commented Sep 10, 2018

Closing since these functions have since been deprecated and removed.

Alternative / equivalent persistence module is documented here:

https://github.com/WordPress/gutenberg/tree/master/packages/data/src/plugins/persistence

@aduth aduth closed this as completed Sep 10, 2018
@aduth aduth added [Status] Not Applicable Issue outside Gutenberg, is not a bug, or is a support request. and removed [Status] Not Applicable Issue outside Gutenberg, is not a bug, or is a support request. labels Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

2 participants