element.version === currentVersion)) { versionNodes.unshift({ version: currentVersion, url: "#" }); } document.querySelector("#project-version").innerHTML = versionNodes.reduce( (acc, element) => { const status = currentVersion === element.version ? "selected disabled" : ""; return ` ${acc} `; }, `
flixi · v1.0.0

flixi

Use the fixi.js hypermedia library with Lustre!

Package Version Hex Docs

gleam add flixi@1
import flixi
import lustre/element.{type Element}
import gleam/http
import lustre/attribute
import lustre/element/html

pub fn fixi_button() -> List(Element(a)) {
  let attributes = [
    // The URL to issue request to
    flixi.action("/content"),
    // The HTTP Method to use
    flixi.method(http.Get),
    // The event that triggers the request
    flixi.trigger("click"),
    // The element to swap
    flixi.target("#output"),
    // How to swap the element
    flixi.swap("innerHTML"),
  ]
  [
    html.button(attributes, [html.text("Get Content")]),
    html.output([attribute.id("output")], []),
  ]
}

Further documentation can be found at https://hexdocs.pm/flixi.

Search Document