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

[Question] Support for PouchDB attachments #8

Open
konnorandrews opened this issue Jul 17, 2017 · 0 comments
Open

[Question] Support for PouchDB attachments #8

konnorandrews opened this issue Jul 17, 2017 · 0 comments

Comments

@konnorandrews
Copy link
Contributor

I have been working on a version of this module that allows some properties of a reducer's state to be saved in an attachment rather than in the document. The original reason for this was I needed to store binary data over 5MB in size. It was going to be implemented as

const finalReducer = persistentReducer(reducer, { attachments: ['image', 'rawData'] });

The state's .image and .rawData properties would then be saved to PouchDB as two different attachments on the reducer's document. However, after thinking about the design, I have decided that the data would not be changed enough to store it actively in the Redux store. Instead it will be attached to the reducer's document by an Redux-Thunk action creator. Then a 'path' to it in pouchDB will be stored in Redux. When a element needs the data it can use the 'path' in Redux to get it from PouchDB.

Does anyone see a use for supporting attachments in this module? I could create a formal implementation of the process described above, but I don't know how the interaction between the action creator, the store, the reducer, and selectors would work. Any thoughts?

By 'path' I mean some type of small data structure that describes what a PouchDB.get() command should retrieve.

@konnorandrews konnorandrews changed the title Support for PouchDB attachments [Question] Support for PouchDB attachments Jul 17, 2017
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

No branches or pull requests

1 participant