<commit_before>
var view = new View();

var elements = ['Fish', 'Mangoes', 'Nougat'];

function list () {
	var items = [];
	elements.forEach( function (element) {
    	items.push(view.h('p', element));
	});
	return view.h('div', items);
}

function redraw () {
	var vdom= view.h('div', [
		list(),
    	view.h('input#value', { type: 'text' }),
		view.h('button#add', 'Add'),
	]);
	view.render(vdom);
}

function clickHandler () {
	elements.push($('#value').val());
	redraw();
}

$( document ).ready(function() {
	redraw();
	$('#add').on('click', clickHandler);
});<commit_msg>transition to object-oriented view layer.<commit_after>function Todo ()
{
	var self = this;
	var view = new View();

	var elements = ['Fish', 'Mangoes', 'Nougat'];

	function list () {
		var items = [];
		elements.forEach( function (element) {
	    	items.push(view.h('p', element));
		});
		return view.h('div', items);
	}

	this.redraw = function () {
		var vdom= view.h('div', [
			list(),
	    	view.h('input#value', { type: 'text' } ),
			view.h('button#add', { onclick: clickHandler }, 'Add'),
		]);
		view.render(vdom);
	}

	function clickHandler () {
		elements.push($('#value').val());
		self.redraw();
	}
}

$(document).ready( function() {
	var todo = new Todo();
	todo.redraw();
});
{'fraction_non_alphanumeric': 0.23089046493301812, 'fraction_numerical': 0.0, 'mean_word_length': 3.9034749034749034, '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': '1823006', 'n_tokens_mistral': 483, 'n_tokens_neox': 459, 'n_words': 98}