Skip to content

Instantly share code, notes, and snippets.

@amitaibu
Created September 7, 2015 18:12
Show Gist options
  • Save amitaibu/d09231ba3993ce991726 to your computer and use it in GitHub Desktop.
Save amitaibu/d09231ba3993ce991726 to your computer and use it in GitHub Desktop.
I have an Effect that is called from my `update` function (e.g. `Effects.batch [someEffect, getDataFromServer]`)
The result of this effect should be piped back as an action, however I was able to do it only using this ugly work around:
getDataFromServer : Effects Action
getDataFromServer =
-- @todo: Get rid of Task.sleep
Task.sleep (0)
|> Task.map (\_ -> GetDataFromServer)
|> Effects.task
How can I fix it and remove the use of `Task.sleep`?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment