Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,3 +810,9 @@ Or you can just run it with one click [on StackBlitz](https://stackblitz.com/~/g

Built on 🌎 with ✍️, 🧠 and a bit of 🤖

## AsFormData (Draft Docs)

Basic example of binding form data to a stream:

```js
import { AsFormData } from "rimmel";
27 changes: 27 additions & 0 deletions examples/asformdata-basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Example: Basic usage of AsFormData with Rimmel
// This is just a placeholder demo for docs — will expand later

import { rml, AsFormData, JSONDump } from 'rimmel';
import { Subject } from 'rxjs';

// Create a stream to collect form data
const formDataStream = new Subject();

document.body.innerHTML = rml`
<form onsubmit="${AsFormData(formDataStream)}">
<label>
Name:
<input name="name" required>
</label>
<br>
<label>
Email:
<input name="email" type="email" required>
</label>
<br>
<button type="submit">Submit</button>
</form>

<h3>Form Output:</h3>
<div>${JSONDump(formDataStream)}</div>
`;