Skip to content

Instantly share code, notes, and snippets.

@faveoled
Created June 23, 2023 16:56
Show Gist options
  • Save faveoled/5a8f7c5bd708eec83412a0ed974e8a2d to your computer and use it in GitHub Desktop.
Save faveoled/5a8f7c5bd708eec83412a0ed974e8a2d to your computer and use it in GitHub Desktop.
Laminar.js button + event handler
val targetWebsiteObserver = Observer[dom.MouseEvent](onNext = ev => {
val newTarget = prompt("Please provide target website link", "https://google.com")
Storage.setTargetWebsite(newTarget)
})
button(
s"Set target links website. Current: ${Storage.getTargetWebsite()}",
onClick --> targetWebsiteObserver
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment