From 1b0b7952337dcf04f5fe15e5400bc1014f78b7c7 Mon Sep 17 00:00:00 2001 From: Chris McCord Date: Fri, 11 Aug 2023 16:55:18 -0400 Subject: [PATCH] Fixup --- .formatter.exs | 13 ------------- lib/phoenix_live_view/async_result.ex | 12 +++++++----- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index 212763e89e..47616780b5 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,17 +1,4 @@ -locals_without_parens = [ - attr: 2, - attr: 3, - live: 2, - live: 3, - live: 4, - on_mount: 1, - slot: 1, - slot: 2, - slot: 3 -] - [ - locals_without_parens: locals_without_parens, import_deps: [:phoenix], inputs: ["*.{ex,exs}", "{config,lib,test}/**/*.{ex,exs}"] ] diff --git a/lib/phoenix_live_view/async_result.ex b/lib/phoenix_live_view/async_result.ex index 521dbd03e0..3ffb847d8f 100644 --- a/lib/phoenix_live_view/async_result.ex +++ b/lib/phoenix_live_view/async_result.ex @@ -398,14 +398,16 @@ defmodule Phoenix.LiveView.AsyncResult do end @doc """ - Cancels an async assign. + Cancels an async operation. + + Accepts either the `%AsyncResult{}` when using `assign_async/3` or + the keys passed to `start_async/3`. ## Examples - TODO fix docs - def handle_event("cancel_preview", _, socket) do - {:noreply, cancel_async(socket, :preview)} - end + cancel_async(socket, :preview) + cancel_async(socket, [:profile, :rank]) + cancel_async(socket, socket.assigns.preview) """ def cancel_async(socket, async_or_keys, reason \\ nil)