Skip to content

Update todo demo#175

Open
smelukov wants to merge 9 commits intomasterfrom
update-todo-demo
Open

Update todo demo#175
smelukov wants to merge 9 commits intomasterfrom
update-todo-demo

Conversation

@smelukov
Copy link
Copy Markdown
Member

No description provided.

Comment thread demo/apps/todomvc/basis/list/list.js Outdated
});
}
else {
Task.active.getItems().forEach(function(item){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tack.active.forEach(...)

Comment thread demo/apps/todomvc/basis/list/list.js Outdated
toggle: function(){
setAccumulateState(true);
if (Task.all.itemCount === Task.completed.itemCount) {
Task.all.getItems().forEach(function(item){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tack.all.forEach(...)

childClass: Item,
action: {
toggle: function(){
setAccumulateState(true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that is needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little optimization, cause we do item.set('completed', false); for every item

},
binding: {
allCompleted: new Expression(
Value.query(Task.all, 'itemCount'),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not index.count()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too complex for this task ;)

Comment thread demo/apps/todomvc/basis/task.js Outdated
Task.extendClass(function(_super, proto){
return {
init: function(){
proto.init.apply(this, arguments);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks redundant

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like I forgot to remove this after some experiments...

Comment thread demo/apps/todomvc/basis/task.js Outdated
init: function(){
proto.init.apply(this, arguments);
},
handler: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad solution, should not add a handler that way

Comment thread demo/apps/todomvc/basis/task.js Outdated
// nothing to do
}

Task.all.addHandler({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task.all.listen -> update instead of handler on instance class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants