question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The Elm Architecture 🍵

See original GitHub issue

Maybe it would be better if effects shouldn’t be called directly by user but go along with result of updating model as a second element in an array or some other structure and that second element should be handled by runtime so it will be look more like TEA:

update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
  case msg of
    MorePlease ->
      (model, getRandomGif model.topic)

    NewGif (Ok newUrl) ->
      ( { model | gifUrl = newUrl }, Cmd.none)

    NewGif (Err _) ->
      (model, Cmd.none)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
tunnckoCorecommented, Feb 10, 2017

Oooh, right TEA means … okey 😄

1reaction
tzellmancommented, Feb 9, 2017

I agree that the example now seems a bit more complex. Maybe all we need to do is state in the docs that the effects do not cause a re-render to occur. Essentially, that is the only difference currently between effects and reducers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Elm Architecture · An Introduction to Elm - Elm Guide
The Elm Architecture is a pattern for architecting interactive programs, like webapps and games. This architecture seems to emerge naturally in Elm. Rather ......
Read more >
The Elm Architecture · GitBook
The Elm Architecture. The Elm Architecture. In this lesson, we'll run a simple Elm application and learn how it all fits together!
Read more >
The Elm Architecture – Simple, yet powerful - Dennis Reimann
The beauty of The Elm Architecture lies in its simplicity: It structures applications into four parts and it defines how these interact with ......
Read more >
The Elm Architecture (TEA) animation | by Lucamug | Medium
This is the backbone of a web application written in the Elm language (https://elm-lang.org/). This loop happens every time something happen ...
Read more >
evancz/elm-architecture-tutorial - GitHub
The Elm Architecture is a simple pattern for architecting webapps. The core idea is that your code is built around a Model of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found