diff --git a/lib/livebook/notebook/explore/kino/custom_kinos.livemd b/lib/livebook/notebook/explore/kino/custom_kinos.livemd index ac1d84d03..b41667d60 100644 --- a/lib/livebook/notebook/explore/kino/custom_kinos.livemd +++ b/lib/livebook/notebook/explore/kino/custom_kinos.livemd @@ -145,11 +145,8 @@ defmodule Kino.Leaflet do @impl true def handle_cast({:add_marker, location}, ctx) do - ctx = - ctx - |> broadcast_event("add_marker", location) - |> update(:locations, &[location | &1]) - + broadcast_event(ctx, "add_marker", location) + ctx = update(ctx, :locations, &[location | &1]) {:noreply, ctx} end @@ -264,6 +261,7 @@ defmodule Kino.Counter do defp bump_count(ctx) do ctx = update(ctx, :count, &(&1 + 1)) broadcast_event(ctx, "update", ctx.assigns.count) + ctx end asset "main.js" do