dwyl / learn-elm-architecture-in-javascript

:unicorn: Learn how to build web apps using the Elm Architecture in "vanilla" JavaScript (step-by-step TDD tutorial)!
https://todomvc-app.herokuapp.com
GNU General Public License v2.0
213 stars 19 forks source link

view function in Todo List App #54

Closed nelsonic closed 6 years ago

nelsonic commented 6 years ago

Now that we have the individual ("lower order") functions render_main #51, render_item #52, and render_footer #53 for rendering the sections of the todo app, we can write the view function to render the entire app!

With the main and footer "partial" views built, the overall view is rediculously simple:

todoapp-view

To save on repetition, and illustrate just how simple the view is, this is the "HTML" with the <section class"main"> and <footer class="footer"> partials replaced by invocations to the respective functions render_main #51 and render_footer #53:

<section class="todoapp">
  <header class="header">
    <h1>todos</h1>
    <input class="new-todo" placeholder="What needs to be done?" autofocus="">
  </header>
  render_main(model)
  render_footer(model)
</section>

Acceptance Criteria

View displays:

nelsonic commented 6 years ago

app.view-not-a-function

nelsonic commented 6 years ago

image