We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Back: @daved, What does the hello world message look like to an outsider?
Front: @nqthqn, what needs to be set up in Elm if we are to communicate with @daved 's hello world message branch?
The text was updated successfully, but these errors were encountered:
You would make a command and then ask Elm to run it for you -
import Http type Msg = GotHello (Result Http.Error String) getHello : Cmd Msg getHello = Http.get { url = "/hello" , expect = Http.expectString GotHello }
Note - not sure on the url and instead of String you would use a generated type alias and decoder from an Entity/ module.
url
String
Entity/
To run the command,
init = (model, getHello)
To react to the response from the command:
update msg model = case msg of GotHello (Ok response) -> ({ model | hello = response }, Cmd.none) GotHello (Err _) -> ({ model | hello = "uh oh" }, Cmd.none)
You could of course pattern match on the Http.Error and give the user more than just "uh oh".
Http.Error
Sorry, something went wrong.
Closed in favor of #76
nqthqn
daved
mckelveygreg
No branches or pull requests
Back:
@daved, What does the hello world message look like to an outsider?
Front:
@nqthqn, what needs to be set up in Elm if we are to communicate with @daved 's hello world message branch?
The text was updated successfully, but these errors were encountered: