Skip to content

Instantly share code, notes, and snippets.

@zwilias
Created July 8, 2017 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zwilias/215def0bc298de6bd1af8987e834c122 to your computer and use it in GitHub Desktop.
Save zwilias/215def0bc298de6bd1af8987e834c122 to your computer and use it in GitHub Desktop.
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