Skip to content

Instantly share code, notes, and snippets.

@bsima
Created November 2, 2017 19:38
Show Gist options
  • Save bsima/6844909f34d6bfd58423c3cef55ef4f8 to your computer and use it in GitHub Desktop.
Save bsima/6844909f34d6bfd58423c3cef55ef4f8 to your computer and use it in GitHub Desktop.
case msg of
AddUserResponse newUsers ->
let
(newUserList, cmd) =
RemoteData.update \(ls -> (List.append ls newUsers, Cmd.none)) model.users
in
( { model | users = newUserList }, cmd )
----
case msg of
AddUserResponse newUsers ->
let
appendRemoteUsers ls =
RemoteData.Success <. List.append ls newUsers
in
( { model | users = RemoteData.andThen appendRemoteUsers model.users }, Cmd.none)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment