Skip to content

Instantly share code, notes, and snippets.

View ostinelli's full-sized avatar

Roberto Ostinelli ostinelli

View GitHub Profile
@ostinelli
ostinelli / 1_searchbar_live.ex
Created May 2, 2024 12:40 — forked from caspg/1_searchbar_live.ex
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
defmodule TravelerWeb.SearchbarLive do
use TravelerWeb, :live_view
alias Phoenix.LiveView.JS
alias Traveler.Places
def mount(_params, _session, socket) do
socket = assign(socket, places: [])
{:ok, socket, layout: false}
end