Skip to content

Commit f74f500

Browse files
committed
fix errors
1 parent 45c2afe commit f74f500

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

dev/live_views/stream.ex

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule LiveDebuggerDev.LiveViews.Stream do
99
|> stream_configure(:another_items, dom_id: &"another-#{&1.id}")
1010
|> assign(:current_id, 0)
1111
|> assign(:another_items_id, 0)
12-
|> assign(:async_loaded?, false)
12+
# |> assign(:async_loaded?, false)
1313
|> stream(:items, [])
1414
|> stream(:another_items, [])
1515

@@ -26,8 +26,8 @@ defmodule LiveDebuggerDev.LiveViews.Stream do
2626
<.button phx-click="insert_at_index">Insert At Index 4</.button>
2727
<.button phx-click="delete_item">Delete Last</.button>
2828
<.button phx-click="reset_items">Reset Stream</.button>
29-
<%!-- <.button phx-click="limit_stream">Limit Stream (5)</.button> --%>
30-
<.button phx-click="async_load">Async Load Items</.button>
29+
<.button phx-click="limit_stream">Limit Stream (5)</.button>
30+
<%!-- <.button phx-click="async_load">Async Load Items</.button> --%>
3131
<.button phx-click="delete_both_last">Delete Last From Both Streams</.button>
3232
</.box>
3333
@@ -178,19 +178,24 @@ defmodule LiveDebuggerDev.LiveViews.Stream do
178178
{:noreply, socket}
179179
end
180180

181-
@impl true
182-
def handle_event("async_load", _params, socket) do
183-
socket =
184-
socket
185-
|> assign(:async_loaded?, false)
186-
|> stream_async(:items, fn ->
187-
Process.sleep(1000)
188-
items = Enum.map(0..9, fn i -> %{id: i, number: Enum.random(1..500)} end)
189-
{:ok, items, reset: true}
190-
end)
181+
# @impl true
182+
# def handle_event("async_load", _params, socket) do
183+
# socket =
184+
# socket
185+
# |> assign(:async_loaded?, false)
186+
# |> stream_async(:items, fn ->
187+
# Process.sleep(1000)
188+
# items = Enum.map(0..9, fn i -> %{id: i, number: Enum.random(1..500)} end)
189+
# {:ok, items, reset: true}
190+
# end)
191191

192-
{:noreply, socket}
193-
end
192+
# {:noreply, socket}
193+
# end
194+
195+
# @impl true
196+
# def handle_info({:async_result, :items, {:ok, _}}, socket) do
197+
# {:noreply, assign(socket, :async_loaded?, true)}
198+
# end
194199

195200
@impl true
196201
def handle_event("delete_both_last", _params, socket) do
@@ -218,9 +223,4 @@ defmodule LiveDebuggerDev.LiveViews.Stream do
218223

219224
{:noreply, socket}
220225
end
221-
222-
@impl true
223-
def handle_info({:async_result, :items, {:ok, _}}, socket) do
224-
{:noreply, assign(socket, :async_loaded?, true)}
225-
end
226226
end

lib/live_debugger/app/debugger/node_state/web/hooks/node_streams.ex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ defmodule LiveDebugger.App.Debugger.NodeState.Web.Hooks.NodeStreams do
6363
{:ok, {fun_list, config_list, stream_names}},
6464
socket
6565
) do
66-
socket =
67-
socket
68-
|> apply_stream_transformations(config_list)
69-
|> assign_stream_names(stream_names)
70-
|> apply_stream_transformations(fun_list)
71-
|> assign(:stream_names, AsyncResult.ok(stream_names))
72-
|> halt()
66+
socket
67+
|> apply_stream_transformations(config_list)
68+
|> assign_stream_names(stream_names)
69+
|> apply_stream_transformations(fun_list)
70+
|> assign(:stream_names, AsyncResult.ok(stream_names))
71+
|> halt()
7372
end
7473

7574
defp handle_async(

lib/live_debugger/services/callback_tracer/actions/state.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule LiveDebugger.Services.CallbackTracer.Actions.State do
1212
alias LiveDebugger.Services.CallbackTracer.Events.StateChanged
1313
alias LiveDebugger.Services.CallbackTracer.Events.StreamUpdated
1414

15-
def maybe_save_state!(%Trace{
15+
def maybe_save_state!(%FunctionTrace{
1616
pid: pid,
1717
function: :render,
1818
type: :return_from,

0 commit comments

Comments
 (0)