RFC: Collections
- Dominant language
- JavaScript
- Stars
- 323
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
⚠️ **this feature is strictly related to the data cascade proposal from #16 and probably should be implemented either together or after the data cascade is implemented**.
xm should be able to render collections of data. For this I imagined we could use a `` tag with a new attribute called `from` (name can be changed).
`from` takes an array of flat objects (a string of JSON), iterates over them and repeats its content while filling the slots:

For advanced use cases `from` accepts:
- glob patterns (grab fills from other HTML files)
- JSON file paths
- path to a JS module that exports an array or a function
- path to a JS module that exports an async function

The async function version is super powerful 💣
async functions can be used to fetch data from an API, database and perform any other asynchronous operation!

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.