ngneat/forms-manager

Support for a custom storage provider

sv-22 opened this issue · 15 comments

sv-22 commented

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

Do you maybe want to create a PR?

Do you maybe want to create a PR?

yip, will do.

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.

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.

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

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

@NetanelBasal I might take this one.

Hi,

Is there any update for this ?

Thx in advance

@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 - ngneat/cashew#21

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

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.

Thanks @NetanelBasal I will start this weekend.

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