Skip to content

Commit 490858f

Browse files
committed
[REF] awesome_owl: correct function names and remove unnecessary default prop
1 parent 8a3dd2e commit 490858f

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

awesome_owl/static/src/counter/counter.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ export class Counter extends Component {
88
optional: true,
99
},
1010
};
11-
static defaultProps = {
12-
callback: () => {},
13-
};
1411

1512
setup() {
1613
this.state = useState({ value: 0 });
1714
}
1815

1916
increment() {
2017
this.state.value++;
21-
this.props.callback();
18+
this.props.callback?.();
2219
}
2320
}

awesome_owl/static/src/todolist/todo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class Todo {
55
this.isCompleted = false;
66
}
77

8-
setCompletion(isCompleted) {
8+
setIsCompleted(isCompleted) {
99
this.isCompleted = isCompleted;
1010
}
1111
}

awesome_owl/static/src/todolist/todolist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class TodoList extends Component {
2525

2626
toggleState(id) {
2727
const todo = this.todos.find(t => t.id === id);
28-
if (todo) todo.setCompletion(!todo.isCompleted);
28+
if (todo) todo.setIsCompleted(!todo.isCompleted);
2929
}
3030

3131
removeTodo(id) {

0 commit comments

Comments
 (0)