VNDB fork of mithril.js
Find a file
impinball 9ae592ee4d Do some local style modifications and profile.
1. Do some temporary style modifications to help make the code more readable
   for profiling (with help from ESLint).
2. Profile the code, and optimize accordingly.
2015-07-23 05:17:02 -04:00
deploy #518 fix package.json file for cdn.js 2015-03-30 14:54:20 -04:00
docs Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
tests Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
.editorconfig tweak editorconfig preferences 2015-04-22 21:00:11 -04:00
.eslintignore Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
.eslintrc Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
.gitattributes Avoid EOL diff horror by enforcing CRLF on commit 2015-04-26 12:53:35 +01:00
.gitignore #686 prevent redraw lock on error 2015-06-23 13:43:54 -04:00
.npmignore adds saucelabs integration to unit tests 2014-07-25 11:23:47 -04:00
.travis.yml Updated Travis CI config to run e2e tests 2014-05-28 23:46:09 +03:00
dragdrop.html rework api 2015-04-09 22:44:45 -04:00
Gruntfile.js Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
guide.html rework api 2015-04-09 22:44:45 -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 fix compile errors in ts file 2015-04-28 22:48:31 -04:00
mithril.js Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
mithril.min.js Add type-checking methods, make a few things stop de-opting under Chrome 2015-07-09 15:31:13 -04:00
mithril.min.js.map Add type-checking methods, make a few things stop de-opting under Chrome 2015-07-09 15:31:13 -04:00
modulator-test.html rework api 2015-04-09 22:44:45 -04:00
mvc.html clean up 2015-04-13 08:29:03 -04:00
onerror.html clean up 2015-04-13 08:29:03 -04:00
package.json Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00
README.md Do some local style modifications and profile. 2015-07-23 05:17:02 -04:00

Note: This is a WIP partial rewrite of Mithril.

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 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() {
	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.module(document.getElementById("example"), app);

Learn more