VNDB fork of mithril.js
Find a file
2014-10-31 21:50:19 -04:00
archive use minified file in guide to match installation 2014-09-28 14:38:29 -04:00
deploy update docs for component 2014-07-02 09:31:36 -04:00
docs fix order issue when trusted content is mixed with other siblings, 2014-10-31 09:31:01 -04:00
tests #317 resolve w/ empty array if empty array 2014-10-31 21:50:19 -04:00
.gitignore initial release 2014-03-16 22:07:53 -04:00
.npmignore adds saucelabs integration to unit tests 2014-07-25 13:35:29 -04:00
.travis.yml Updated Travis CI config to run e2e tests 2014-05-28 23:46:09 +03:00
Gruntfile.js fix order issue when trusted content is mixed with other siblings, 2014-10-31 09:31:01 -04:00
LICENSE Initial commit 2014-03-16 18:59:39 -07:00
mithril.closure-compiler-externs.js externs for closure compiler 2014-07-21 22:48:24 -04:00
mithril.d.ts document deps 2014-09-20 16:55:57 -04:00
mithril.js #317 resolve w/ empty array if empty array 2014-10-31 21:50:19 -04:00
package.json Add a main script in package.json. 2014-08-03 17:09:57 +02:00
README.md fix size in readme 2014-09-14 21:41:00 -04:00

Build Status

Mithril

A Javascript Framework for Building Brilliant Applications

See the website for documentation

There's also a blog and a mailing list


What is Mithril?

Mithril is a client-side MVC framework - a tool to organize code in a way that is easy to think about and to maintain.

Light-weight

  • Only 5kb gzipped, no dependencies
  • Small API, small learning curve

Robust

  • Safe-by-default templates
  • Hierarchical MVC via components

Fast

  • Virtual DOM diffing and compilable templates
  • Intelligent auto-redrawing system

Sample code

//namespace
var app = {};

//model
app.PageList = function() {
	return m.request({method: "GET", url: "pages.json"});
};

//controller
app.controller = function() {
	this.pages = app.PageList();
	
	this.rotate = function() {
		this.pages().push(this.pages().shift())
	}.bind(this)
};

//view
app.view = function(ctrl) {
	return [
		ctrl.pages().map(function(page) {
			return m("a", {href: page.url}, page.title);
		}),
		m("a", {onclick: ctrl.rotate}, "Rotate links")
	];
};

//initialize
m.module(document.getElementById("example"), app);

Learn more