VNDB fork of mithril.js
Find a file
2016-07-06 10:54:46 +02:00
archive Bump to v0.2.4 for m.version 2016-04-26 20:58:20 +09:00
bench Remove an erroneous npm-debug.log, disable failing test 2016-03-02 13:55:48 -05:00
deploy #518 fix package.json file for cdn.js 2015-03-30 14:54:20 -04:00
docs Update mithril.md 2016-06-17 16:13:02 +01:00
test Added tests for history modification when switching routes with parameters (#1125) 2016-07-06 10:54:46 +02:00
test-deps Merge branch 'next' of https://github.com/lhorie/mithril.js into test-fix 2016-03-02 14:05:21 -05:00
tests Render booleans as empty strings 2016-06-10 11:00:56 -04:00
.editorconfig tweak editorconfig preferences 2015-04-22 21:00:11 -04:00
.eslintignore Actually lint core, regenerate minified files 2016-03-28 07:54:26 -04:00
.eslintrc cleanup and apply editorconfig 2016-06-20 16:15:59 +08:00
.gitattributes Minified files are binary enough to count. 2016-03-02 15:40:27 -05:00
.gitignore Remove an erroneous npm-debug.log, disable failing test 2016-03-02 13:55:48 -05:00
.npmignore adds saucelabs integration to unit tests 2014-07-25 11:23:47 -04:00
.travis.yml Convert tests to Mocha/Chai/Sinon and lint them. 2015-10-31 11:07:22 -04:00
CONTRIBUTING.md v0.2.2-rc.1 2015-12-20 09:14:28 -05:00
Gruntfile.js Make linter happy with Mithril.js 2016-03-02 16:27:08 -05:00
index.d.ts Add definition file to npm [ci skip] 2016-06-17 06:09:04 -04:00
ISSUE_TEMPLATE.md issue template 2016-06-06 09:53:37 -04:00
LICENSE Initial commit 2014-03-16 18:59:39 -07:00
mithril.closure-compiler-externs.js Update externs for Google Closure compiler 2015-08-04 16:57:13 +02:00
mithril.d.ts Add definition file to npm [ci skip] 2016-06-17 06:09:04 -04:00
mithril.js Push route to history stack, when using parameters 2016-06-23 08:49:18 +02:00
mithril.min.js #1080 parse pattern attribute correctly 2016-06-01 15:42:08 -04:00
mithril.min.js.map #1080 parse pattern attribute correctly 2016-06-01 15:42:08 -04:00
package.json Add definition file to npm [ci skip] 2016-06-17 06:09:04 -04:00
README.md Fixes js.org badge link. 2016-05-30 20:54:18 +03:00

JS.ORG Join the chat at https://gitter.im/lhorie/mithril.js 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 7.8 kB 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() {
	var pages = app.PageList();
	return {
		pages: pages,
		rotate: function() {
			pages().push(pages().shift());
		}
	}
};

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


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

Learn more