From adead74207f230f1744ff0d8c9fb879284bc466b Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Mon, 17 Feb 2020 16:36:01 -0600 Subject: [PATCH] split out task/non-task findAttachmentTops --- src/Main.elm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Main.elm b/src/Main.elm index 4d674b9..58dff02 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -10,7 +10,7 @@ import Html exposing (Html) import Html.Attributes as Attrs import Html.Events import Json.Decode as Decode -import Task +import Task exposing (Task) type alias Model = @@ -71,15 +71,11 @@ update msg model = ( model, Cmd.none ) AttachmentsMoved tops -> - let - _ = - Debug.log "tops" tops - in ( model, Cmd.none ) -findNewAttachmentTops : List Int -> Cmd Msg -findNewAttachmentTops ids = +findNewAttachmentTopsTask : List Int -> Task Never (List ( Int, Float )) +findNewAttachmentTopsTask ids = -- TODO: this may need Process.sleep 0 to be accurate in all cases ids |> List.map @@ -90,7 +86,11 @@ findNewAttachmentTops ids = ) |> Task.sequence |> Task.map (List.filterMap identity) - |> Task.perform AttachmentsMoved + + +findNewAttachmentTops : List Int -> Cmd Msg +findNewAttachmentTops ids = + Task.perform AttachmentsMoved (findNewAttachmentTopsTask ids) view : Model -> Browser.Document Msg