VNDB fork of mithril.js
Find a file
webcss e158b52c47 fix for #428 introduces new misbehaviour
The fix for #428 provided prevents entries beeing written to history. History.back() or hitting browsers back-button don't work anymore, since there are no history entries. 
This is because you are assigning the new path to route to to currentPath and compare these, which always turn out to be equal. Saving the currentPath before the assignment fixes this missbehaviour.
2015-01-30 11:20:53 +01:00
archive v0.1.29 publish 2015-01-27 21:09:45 -05:00
deploy update docs for component 2014-07-02 09:31:36 -04:00
docs #424 fix key association when DOM is modified by external code 2015-01-27 20:53:58 -05:00
tests #424 fix key association when DOM is modified by external code 2015-01-27 20:53:58 -05:00
.gitignore restoring state 2014-11-13 21:50:26 -05: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
Gruntfile.js v0.1.29 publish 2015-01-27 21:09:45 -05: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 update ts file 2015-01-19 23:27:47 -05:00
mithril.js fix for #428 introduces new misbehaviour 2015-01-30 11:20:53 +01:00
mithril.min.js v0.1.29 publish 2015-01-27 21:09:45 -05:00
mithril.min.js.map v0.1.29 publish 2015-01-27 21:09:45 -05:00
package.json Merge branch 'jsfmt' into next 2015-01-19 22:59:53 -05:00
README.md doc tweaks 2014-11-12 20:06:24 -05: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 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