VNDB fork of mithril.js
Find a file
impinball d7ef127be2 Isolate m.prop() and m.deferred() implementations (mostly)
This mostly isolates the implementations for both of these. Now, everything
here calls the method itself, not any of the external methods.

Few driveby fixes as well:

1. Git now ignores archive/ again (it's a build artifact, and can be removed
   when updating `master`)
2. Since I had to rewrite most of the Deferred implementation, the new version
   passes one of the skipped tests, so it is now enabled.
2015-11-20 02:49:48 -05:00
deploy #518 fix package.json file for cdn.js 2015-03-30 14:54:20 -04:00
docs Fixed syntax error in example 2015-11-12 10:56:46 -05:00
test Isolate m.prop() and m.deferred() implementations (mostly) 2015-11-20 02:49:48 -05:00
test-deps Lint Mithril main 2015-11-03 01:32:17 -05:00
.editorconfig tweak editorconfig preferences 2015-04-22 21:00:11 -04:00
.eslintignore Lint Mithril main 2015-11-03 01:32:17 -05:00
.eslintrc Misread ESLint docs... 2015-11-11 21:40:32 -05:00
.gitattributes Avoid EOL diff horror by enforcing CRLF on commit 2015-04-26 12:53:35 +01:00
.gitignore Isolate m.prop() and m.deferred() implementations (mostly) 2015-11-20 02:49: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
dragdrop.html m.module -> m.mount: fix sample code in HTML files 2015-08-28 09:07:08 -03:00
Gruntfile.js Revert to lowercase NPM package name 2015-11-13 08:40:08 +01:00
guide.html m.module -> m.mount: fix sample code in HTML files 2015-08-28 09:07:08 -03: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 Typescript: Make MithrilVirtualElement non-generic 2015-10-14 17:27:22 -04:00
mithril.js Isolate m.prop() and m.deferred() implementations (mostly) 2015-11-20 02:49:48 -05:00
mithril.min.js Isolate m.prop() and m.deferred() implementations (mostly) 2015-11-20 02:49:48 -05:00
mithril.min.js.map Isolate m.prop() and m.deferred() implementations (mostly) 2015-11-20 02:49:48 -05:00
modulator-test.html Remove trailing whitespace 2015-07-09 03:38:42 -04:00
mvc.html Change m.mount to m.component in sample html 2015-11-12 04:34:20 +09:00
onerror.html clean up 2015-04-13 08:29:03 -04:00
package.json Revert to lowercase NPM package name 2015-11-13 08:40:08 +01:00
README.md remove broken badge 2015-11-12 18:54:08 -05: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 7kb 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