Form state
A form whose state is a stream:
- Edits push into
formData$and fold together withscan, seeded fromlocalStorage. - Submitting samples the latest data with
withLatestFrom. switchMapruns the storage write, emittingsavingthensaved. Those states drive the button label.
The hook split: field values read useSyncObservable (controlled inputs), while the submit state reads useObservable.
Try it: submit, then reload the sandbox preview. The form comes back from storage.
Last updated on