Comments (5)
While this is not a "high priority", I feel that it's good practice
and will help a complete beginner to understand TEA + TodoMVC a bit better.
So ... I'm thinking of tackling it.
from learn-elm-architecture-in-javascript.
http://todomvc.com/examples/vanillajs/
from learn-elm-architecture-in-javascript.
View Source of TodoMVC to analyse what HTML elements we need to create.
<section class="todoapp">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus="">
</header>
<section class="main" style="display: block;">
<input id="toggle-all" class="toggle-all" type="checkbox">
<label for="toggle-all">Mark all as complete</label>
<ul class="todo-list">
<li data-id="1531397960010" class="completed">
<div class="view">
<input class="toggle" type="checkbox" checked="">
<label>Learn The Elm Architecture ("TEA")</label>
<button class="destroy"></button>
</div>
</li>
<li data-id="1531397981603" class="">
<div class="view">
<input class="toggle" type="checkbox">
<label>Build TEA Todo List App</label>
<button class="destroy">
</button>
</div>
</li>
</ul>
</section>
<footer class="footer" style="display: block;">
<span class="todo-count"><strong>1</strong> item left</span>
<ul class="filters">
<li>
<a href="#/" class="selected">All</a>
</li>
<li>
<a href="#/active" class="">Active</a>
</li>
<li>
<a href="#/completed">Completed</a>
</li>
</ul>
<button class="clear-completed" style="display: block;">Clear completed</button>
</footer>
</section>
from learn-elm-architecture-in-javascript.
localStorage
sample code:
var model = { 'one': 1, 'two': 2, 'three': 3 };
// save the model (data) into storage as a stringified object:
localStorage.setItem('elmish_store', JSON.stringify(model));
// Retrieve the stringified object from localStorage:
var retrieved_model = localStorage.getItem('elmish_store');
console.log('Retrieved model: ', JSON.parse(retrieved_model));
from learn-elm-architecture-in-javascript.
It's occurred to me that I have the incorrect parameter order in the update
function ...
The function signature in Elm is: update : Msg -> Model -> ( Model, Cmd Msg )
https://www.elm-tutorial.org/en/08-edit/05-update.html
We have update(model, action)
Let's "fix" this.
from learn-elm-architecture-in-javascript.
Related Issues (20)
- Toggle All Todo List Items HOT 1
- Main Todo List View <section class="main"> HOT 2
- render_item renders the DOM for a Single Todo List item HOT 1
- render_footer renders the <footer> element of Todo App HOT 3
- view function in Todo List App HOT 2
- UX Feature Hitting the [Enter] (Return) key creates a new Todo List item HOT 1
- 1. No Todos, should hide #footer and #main HOT 3
- Subscriptions: How to "Listen" for Events and What to do ... HOT 1
- Elm(ish) onClick Event/Function Attribute HOT 1
- DELETE a Todo List item using the "cross" (button) HOT 1
- EDIT an item HOT 9
- Gif on line 169 of README needs updating HOT 5
- BUG! Failing to supply the model as an argument to subscriptions ... HOT 1
- [esc] key cancels editing mode (without saving) HOT 1
- Serve Examples on Heroku HOT 3
- How would you handle HTTP requests? HOT 4
- Update JSDOM devDependency
- The Elm Architecture (TEA) animation
- Where do I start (my TDD quest) ?
- app.update is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learn-elm-architecture-in-javascript.