Create a gist now

Instantly share code, notes, and snippets.

@zwilias /Condensed.elm Secret
Created Jul 8, 2017

import Http
import Process
import Time exposing (Time)
import Task
import RemoteData exposing (WebData)
sendDelayedRequest : Time -> Http.Request a -> (WebData a -> msg) -> Cmd msg
sendDelayedRequest delay request tagger =
Process.sleep delay
|> Task.andThen (\_ -> Http.toTask request)
|> RemoteData.fromTask
|> Task.perform tagger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment