VNDB fork of mithril.js
Find a file
2014-07-04 22:47:10 -04:00
archive publish v0.1.18 2014-07-03 22:32:44 -04:00
deploy update docs for component 2014-07-02 09:31:36 -04:00
docs fix context unloading when reattaching 2014-07-03 22:31:04 -04:00
tests fix context unloading when reattaching 2014-07-03 22:31:04 -04:00
.gitignore initial release 2014-03-16 22:07:53 -04:00
.travis.yml Updated Travis CI config to run e2e tests 2014-05-28 23:46:09 +03:00
background.html add social media section to home page 2014-05-15 17:13:16 -04:00
Gruntfile.js clear diff cache when routing 2014-07-03 22:11:29 -04:00
LICENSE Initial commit 2014-03-16 18:59:39 -07:00
mithril.d.ts document new argument in m.route(path) 2014-05-25 23:52:46 -04:00
mithril.js fix class/className concat bug when they're defined in both selector and attrs 2014-07-04 22:47:10 -04:00
package.json Added end to end test suite and test for issue #99 2014-05-28 22:23:18 +03:00
README.md beef up readme and make blog more prominent 2014-06-27 16:07:42 -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 4kb 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