<commit_before>import { createElement, Component } from 'didact';
import TodoModel from './model';
import TodoFooter from './footer';
import TodoItem from './item';

const ENTER_KEY = 13;

const FILTERS = {
	all: todo => true,
	active: todo => !todo.completed,
	completed: todo => todo.completed
};

export default class App extends Component {
	constructor() {
		super();
		this.model = new TodoModel('didact-todos', () => this.setState({}) );
		addEventListener('hashchange', this.handleRoute.bind(this));
		let nowShowing = this.getRoute();
		this.state = { nowShowing };
	}

	getRoute() {
		let nowShowing = String(location.hash||'').split('/').pop();
		if (!FILTERS[nowShowing]) {
			nowShowing = 'all';<commit_msg>Add defaults<commit_after>import { createElement, Component } from 'didact';
import TodoModel from './model';
import TodoFooter from './footer';
import TodoItem from './item';

const ENTER_KEY = 13;

const FILTERS = {
	all: todo => true,
	active: todo => !todo.completed,
	completed: todo => todo.completed
};

export default class App extends Component {
	constructor() {
		super();
		this.model = new TodoModel('didact-todos', () => this.setState({}) );
		addEventListener('hashchange', this.handleRoute.bind(this));
		let nowShowing = this.getRoute();
		this.state = { 
			nowShowing,
			newTodo: "",
			editing: ""
		};
	}

	getRoute() {
		let nowShowing = String(location.hash||'').split('/').pop();
		if (!FILTERS[nowShowing]) {
			nowShowing = 'all';
{'fraction_non_alphanumeric': 0.16926201760324983, 'fraction_numerical': 0.002708192281651997, 'mean_word_length': 4.4338235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2470295', 'n_tokens_mistral': 520, 'n_tokens_neox': 482, 'n_words': 118}