VNDB fork of mithril.js
Find a file
Barney Carroll 6e60ed5720 "Currently active component" is ambiguous at best
It seems this condition is put here to reassure users that redrawing in a given route state will not draw the views of components for other routes, but it's difficult to imagine how somebody might worry that might happen.

As it is, people end up believing that redraw acts per-component, which is highly misleading in a situation where there are nested components or multiple mount points, and the call to redraw is invoked within one of those components.
2016-02-07 19:20:31 +00:00
archive fix for issue #915 2016-01-17 19:31:17 -05:00
bench Merge branch 'lint' of https://github.com/isiahmeadows/mithril.js into isiahmeadows-lint 2016-01-28 18:40:19 -05:00
deploy #518 fix package.json file for cdn.js 2015-03-30 14:54:20 -04:00
docs "Currently active component" is ambiguous at best 2016-02-07 19:20:31 +00:00
test Merge branch 'lint' of https://github.com/isiahmeadows/mithril.js into isiahmeadows-lint 2016-01-28 18:40:19 -05:00
test-deps Lint old tests 2016-01-22 14:07:25 -05:00
tests Merge branch 'lint' of https://github.com/isiahmeadows/mithril.js into isiahmeadows-lint 2016-01-28 18:40:19 -05:00
.editorconfig tweak editorconfig preferences 2015-04-22 21:00:11 -04:00
.eslintignore Lint Mithril itself 2016-01-22 16:25:55 -05:00
.eslintrc Merge 'origin/patch-2', remove trailing commas 2015-11-25 22:45:45 -05:00
.gitattributes Avoid EOL diff horror by enforcing CRLF on commit 2015-04-26 12:53:35 +01:00
.gitignore v0.2.2-rc.1 2015-12-20 09:14:28 -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 disable tests that break due to lack of innerHTML api in node 2015-12-20 09:24:04 -05: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 Added an overload for withAttr. Added parameters to component controller and view functions. 2016-01-30 12:22:01 -05:00
mithril.js remove is attribute regular element creation 2016-01-29 16:27:09 -05:00
mithril.min.js build 2015-12-20 09:27:31 -05:00
mithril.min.js.map build 2015-12-20 09:27:31 -05:00
package.json Merge pull request #907 from isiahmeadows/update 2015-12-20 16:40:08 -05:00
README.md Small documentation tweak 2015-12-31 23:00:37 +13: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