I guess what you need here is 
Task.andThen 
http://package.elm-lang.org/packages/elm-lang/core/latest/Task#andThen

See this snippet I've found on 
github 
https://github.com/fpapado/elm-flickr-gallery/blob/c040f61575f4f47ce216df1820b42d1751ccdb7a/src/Main.elm#L56

Hope it helps.

On Monday, February 6, 2017 at 10:46:08 AM UTC+2, Kingsley Hendrickse wrote:
>
> Thanks
>
> I don't quite understand how to chain using Task
>
> I want to first do getCurrentUser Http request and then do 
> notifyOnLocationChange a regular task - but I can't understand how Task 
> could do this.
> Even chaining 2 http requests I don't understand since in order to fire a 
> Task you have use Task.perform or Task.attempt giving them the Msg - this 
> doesn't seem doable with Task
>
> getCurrentUser : Cmd Msg
> getCurrentUser =
>   Http.toTask (Http.get "/currentUser" decodeLogin)
>   |> Task.attempt CurrentUserResponse
>
>
> notifyOnLocationChange: Cmd Msg
> notifyOnLocationChange location =
>   Task.perform OnLocationChange (succeed location)
>
>
> any help appreciated 
>
>
>
> On Sunday, 5 February 2017 20:34:56 UTC, John Kelly wrote:
>>
>> Take a look at toTask: 
>> http://package.elm-lang.org/packages/elm-lang/http/1.0.0/Http#toTask
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to