tsloughter/OpaDo — Issue #8: Faster loading
Author: Dandandan
Created: 2012-02-27 10:35:36+00:00
State: open

OpaDo loads items when ready, but faster is to load items in one time. Unfornately can't run OpaDo because my version is to new and don't have time to change the "resource". But something like this will do?
```
function todo_line(string id, string value, bool is_done) {

{ value }

}

function add_todo_to_page(string id, string value, bool is_done) {
Dom.transform([#todo_list =+ line(id, value, is_done]);
Dom.scroll_to_bottom(#todo_list);
Dom.set_value(#new_todo, "");
update_counts()
}

function todos(){
if (User.is_logged()){
mypage("Todos",todos_page())
} else {
mypage("Sign Up",User.new())
}
}

function todos_page() {

Logout

{
username = User.get_username();
items = /todo_items[username];
StringMap.map((function(x,y){todo_line(x, y.value, y.done)}), items)
}

Clear
0
completed items

0
items left

Note: This is beta version. No guarentee your data wont be lost.

}
```