Directives and resources
repeat(items, key, render)
Renders a collection while preserving DOM identity by item key.
keyed(key, template)
Forces one template region to be replaced when its key changes. Use it when a new identity must reset DOM state.
unsafeHTML(value)
Renders a string as HTML. Only pass content that your application has already trusted or sanitized. Cami does not sanitize it.
useImage(element, src)
Loads and decodes an image through the owning element's resource lifecycle.
It returns Resource<ImageResource>. Successful data contains src, width, and height. Cami cancels stale work when the owner disconnects or the request changes.
Resource<T>
Resource<T> is a discriminated union keyed by status:
idle,loading, orrefreshingmay contain previous data;successcontains data;errorcontains an error and may contain previous data.
Use store queries for server data shared by several islands. Use a component resource for work owned by one element.