Signal drop!
Relay (operand.online) is unreachable.
Usually, a dropped signal means an upgrade is happening. Hold on!
Sorry, no connección.
Hang in there while we get back on track
gram:panel
> ./src/page.gleam
Lenses
(coming soon!)
import gleam/result
import gleam/javascript/array
import plinth/javascript/console
import plinth/browser/window
import plinth/browser/document.{query_selector_all}
import plinth/browser/element.{get_attribute, inner_text}
pub type Link {
Link(label: String, address: String)
}
pub fn main() {
console.log("running in: " <> window.location())
query_selector_all("a") |> array.map(fn(a) { Link(
a |> inner_text(),
a |> get_attribute("href") |> result.lazy_unwrap(fn () { "" })
) }) |> console.log
}