-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add persist form functionality #24
Comments
I wonder if you'd like to follow a more functional approach for the API on this one. Something along the lines of import { LocalStorageManager } from '@ngneat/reactive-forms';
const profileForm = new FormGroup<Profile>({
firstName: new FormControl(''),
lastName: new FormControl(''),
});
LocalStorageManager.serialize(key, profileForm)
LocalStorageManager.deserialize(key) It would allow the feature to scale with more managers like Not sure about this claim, but I suppose this could be easier to tree shake rather than having a I don't have any problem with |
We can combine the ideas and create something like:
I think we still need to provide at least the default behavior and save it to |
It'll be great to add a built-in method to persist the form value to the storage. For example:
Where the
key
is the storage key, and the storage islocal
orsession
.The text was updated successfully, but these errors were encountered: