Skip to content

Instantly share code, notes, and snippets.

@ciscoheat
ciscoheat / domready.js
Created February 10, 2016 20:36 — forked from ded/domready.js
Smallest x-browser DOM Ready, ever [WORKING]
function r(f){/(un|ing)/.test(document.readyState)?setTimeout(r,9,f):f()}
import js.Browser;
import mithril.M;
class App implements Mithril {
public static function main() {
M.mount(Browser.document.body, new App());
}
var tests = [];
@ciscoheat
ciscoheat / Example.hx
Last active August 29, 2015 14:14 — forked from cambiata/Example.hx
Using a View instead of a Module
class User implements Model {
@prop public var name : String;
public function new(name) {
this.name = M.prop(name);
}
}
class TestModule implements View {
var user:User;
// The following will be macromagically transformed...
class LazyExample implements Lazy
{
var values:Array<Int>;
public function new()
{
this.values = [3, 5, 1, 7];
}