milo
A minimalist browser framework that binds DOM elements to JS components and components to models.
milo
is available as global object in the browser.
At the moment it is not possiible to require it with browserify to have it bundled with the app because of the way brfs browserify plugin is implemented.
It is possible though to require milo
with node to use universal parts of the framework (abstract classes, Messenger, Model, etc.):
var milo = require('milojs');
milo
itself is a function that in the browser can be used to delay execution until DOM is ready.
function milo(func) {
milo.util.domReady(func);
}
####Milo packages####
window.postMessage
._.extend(milo, {
Messenger: miloCore.Messenger,
Model: miloCore.Model,
minder: miloCore.minder,
loader: require('./loader'),
binder: require('./binder'),
mail: require('./services/mail'),
window: require('./services/window'),
config: require('./config'),
util: require('./util'),
classes: require('./classes'),
attributes: require('./attributes'),
ComponentFacet: require('./components/c_facet'),
Component: require('./components/c_class'),
Command: require('./command'),
registry: require('./registry'),
milo_version: '0.2.6',
createComponentClass: require('./util/create_component_class'),
createFacetClass: require('./util/create_facet_class'),
destroy: destroy
});
// export for node/browserify
if (typeof module == 'object' && module.exports)
module.exports = milo;
// global milo for browser
if (typeof window == 'object') {
window.milo = milo;
milo.mail.trigger('miloready');
}
function destroy() {
miloCore.destroy();
milo.mail.destroy();
milo.window.destroy();
milo.util.destroy();
}