ngneat / forms-manager

🦄 The Foundation for Proper Form Management in Angular
https://www.netbasal.com
MIT License
518 stars 29 forks source link

Support for a custom storage provider #6

Open sv-22 opened 4 years ago

sv-22 commented 4 years ago

This module supported a custom storage provider when it was part of Akita. Now, it appears only to support localStorage. Limitations of localStorage are well known and it would be nice if the old functionality was brought back so that the state could be saved to things like IndexedDB or similar. This is specially vital for things like hybrid apps where webview storage may be purged by the OS and the only way to ensure persistence of the data is to save it to SQLite or similar. Support for a custom storage provider or at least IndexedDB would be nice. Thanks

NetanelBasal commented 4 years ago

Do you maybe want to create a PR?

sv-22 commented 4 years ago

Do you maybe want to create a PR?

yip, will do.

Destreyf commented 4 years ago

I wanted to add my 2 cents here, I'm looking at using this library for a complex project that's coming up, it looks like a great fit but I want up add another layer to the storage system, it would be nice if there was an adapter like system that could be plugged either at a module config level or perhaps at the time that you attach the form manager to the form group.

Essentially my is use case is to create a real time editor with collaborative functionality, having an adapter that could broadcast that changes would be helpful, I haven't tried to POC this yet but I believe it would work for my use case.

I could always write my own code to handle it directly with the form groups, but I believe with a little work it could be flexible enough to handle it.

Destreyf commented 4 years ago

Oops, forgot to clarify, I would be using an websocket to store drafts and state, so I would intend to leverage this as a network back end essentially. Backed by redis for the session.

NetanelBasal commented 4 years ago

@Destreyf, you're welcome to submit a PR.

Destreyf commented 4 years ago

@NetanelBasal I'll be looking into this more next week, I just happened to stumble onto your library from the akita blog post.

stefanoww commented 3 years ago

@NetanelBasal I might take this one.

NetanelBasal commented 3 years ago

Ok

TakeshiDaveau commented 3 years ago

Hi,

Is there any update for this ?

Thx in advance

va-stefanek commented 3 years ago

@NetanelBasal I am thinking whether you sees an option to put that functionality into some package or something, because there is similar request in another lib - https://github.com/ngneat/cashew/issues/21

NetanelBasal commented 3 years ago

If I would create a package, would you do it, and use it in both libraries?

va-stefanek commented 3 years ago

Yea I am eager to help, very similar functionality is in the https://github.com/ngneat/reactive-forms. I might even help with the lib if you would like to.

NetanelBasal commented 3 years ago

https://github.com/ngneat/storage

va-stefanek commented 3 years ago

Thanks @NetanelBasal I will start this weekend.

va-stefanek commented 3 years ago

@NetanelBasal I need your help with releasing it to the npm, am I allowed to do that?