There are two ways to instantiate a FruitMachine module:
var apple = new Apple();
var apple = fruitmachine({ module: 'apple' });
Use Explicit instantiation over Lazy instantiation whenever possible. The Lazy instantiation option exists so that you are able to predefine page layouts in JSON form and pass them into the fruitmachine()
factory method.
When instantiating 'lazily' FruitMachine looks at the module
property and attempts to map it to a module you have defined using fruitmachine.define(). If a match is found, it will Explictly
instantiate that module with the options you originally passed.
id {String}
Your unique id for this View modulemodule {String}
The module type (only use if using 'Lazy' instantiation)children {Array}
An array of child views to instantiate (can be lazy JSON or view instances)model {Object}
A data model object that will be accessible in your templatehelpers {Array}
An array of helper functions to be called on instantiationclasses {Array}
Classes to be added to the root elementtemplate {Function}
A template function that will return HTML (will any existing template)tag {String}
The tag to use for the root element (defaults to 'div')