Skip to content

Documentation: Document missing methods for data module #7015

Closed

Description

@gziolo

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.

Activity

  1. aduth commented on Sep 10, 2018

    @aduth
    Member

    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

  2. added
    [Status] Not ApplicableIssue outside Gutenberg, is not a bug, or is a support request.
    and removed
    [Status] Not ApplicableIssue outside Gutenberg, is not a bug, or is a support request.
    on Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Type] Developer DocumentationDocumentation for developers

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions