Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tpresley committed May 22, 2024
1 parent f19add2 commit 4d51c4b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,13 @@ RootComponent.model = {

Another very common task in web pages and browser applications is to work with form inputs. Unfortunately, the logic and stream plumbing required to do this routine task can be challenging to developers new to observables (and is frustrating even for most veterans). Sygnal's processForm() helper function takes any HTML form element, and automatically extracts the values from all input fields contained within it. By default processForm() listens to both 'input' and 'submit' events, but can be configured to listen to any combination of standard or custom events on the form itself or its inputs.

The Observable from `processForm` always returns objects with the current value of every field in the form, so the following will print something like:
The Observable from `processForm` always returns objects with the current value of every field in the form along with the name of the JS event that initiated it, so the following will print something like:

```javascript
{
'first-name': 'First',
'last-name': 'Last'
'first-name': 'Bob',
'last-name': 'Smith',
eventType: 'submit'
}
```

Expand Down

0 comments on commit 4d51c4b

Please sign in to comment.