<commit_before>import * as ko from 'knockout';
import {Todo} from './todo.model.js';

export class ViewModel {
    constructor() {
        this.todoList = [new Todo("Try javaScript"), new Todo("Buy a Unicorn")]        
    }

    toggleChecking(todo) {
        todo.checked(!todo.checked());
    }
}<commit_msg>Added method to push new todo item into TodoList, deleted default todos<commit_after>import * as ko from 'knockout';
import {Todo} from './todo.model.js';

export class ViewModel {
    constructor() {
        this.todoList = ko.observableArray([]);        
        this.inputText = ko.observable("");
    }

    toggleChecking(todo) {
        todo.checked(!todo.checked());
    }

    addNewTodo(todo, event) {
        if(event.keyCode === 13) {
            const text = this.inputText();
            const todo = new Todo(text);            
            this.todoList.unshift(todo);                
            this.inputText("");
        }        
    }
}
{'fraction_non_alphanumeric': 0.13547052740434332, 'fraction_numerical': 0.002068252326783868, 'mean_word_length': 2.1025641025641026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1847670', 'n_tokens_mistral': 301, 'n_tokens_neox': 294, 'n_words': 66}