GithubHelp home page GithubHelp logo

dudeman / mithril.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mithriljs/mithril.js

0.0 2.0 0.0 2.4 MB

A Javascript Framework for Building Brilliant Applications (development repo)

Home Page: http://lhorie.github.io/mithril

License: MIT License

JavaScript 94.02% CSS 5.98%

mithril.js's Introduction

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

mithril.js's People

Contributors

aembke avatar barneycarroll avatar blacha avatar bsuh avatar cbowdon avatar der-on avatar eiriksm avatar evrijkom avatar franknova avatar gsteacy avatar jmventura avatar johnmarkos avatar lhorie avatar livtanong avatar mambocab avatar nijikokun avatar o-klp avatar oleg8sh avatar pistolero avatar purcell avatar pygy avatar randymorris avatar richardasymmetric avatar sanderhahn avatar thatsmydoing avatar whoaa512 avatar yolk avatar ysimonson avatar zolmeister avatar zzmp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.