autocrat.js
function Autocrat(options) {
  this.options = parseOptions(this, options);

  /**
   * A namespace to host members related to observing state/Autocrat activity
   *
   * @name surveillance
   * @namespace
   */
  surveillance.serveAutocrat(this);
  this.surveillance = surveillance;

  /**
   * Has a dual nature as both an array and a namespace. The array members are
   * plugins, which are essentially mixins for the Autocrat singleton. 
   * The namespace is used a general storage for plugin related methods and
   * information
   *
   * @name constitution
   * @namespace
   */
  constitution.serveAutocrat(this);

  Ward.serveAutocrat(this);
  this.Ward = Ward;

  Advisor.serveAutocrat(this);
  this.Advisor = Advisor;

  Governor.serveAutocrat(this);
  this.Governor = Governor;

  Domain.serveAutocrat(this);
  this.Domain = Domain;

  Law.serveAutocrat(this);
  this.Law = Law;
}
function Autocrat(options) {
  this.options = parseOptions(this, options);

  /**
   * A namespace to host members related to observing state/Autocrat activity
   *
   * @name surveillance
   * @namespace
   */
  surveillance.serveAutocrat(this);
  this.surveillance = surveillance;

  /**
   * Has a dual nature as both an array and a namespace. The array members are
   * plugins, which are essentially mixins for the Autocrat singleton. 
   * The namespace is used a general storage for plugin related methods and
   * information
   *
   * @name constitution
   * @namespace
   */
  constitution.serveAutocrat(this);

  Ward.serveAutocrat(this);
  this.Ward = Ward;

  Advisor.serveAutocrat(this);
  this.Advisor = Advisor;

  Governor.serveAutocrat(this);
  this.Governor = Governor;

  Domain.serveAutocrat(this);
  this.Domain = Domain;

  Law.serveAutocrat(this);
  this.Law = Law;
}
function Autocrat ( options ) { this . options = parseOptions ( this , options ) ; /**
   * A namespace to host members related to observing state/Autocrat activity
   *
   * @name surveillance
   * @namespace
   */ surveillance . serveAutocrat ( this ) ; this . surveillance = surveillance ; /**
   * Has a dual nature as both an array and a namespace. The array members are
   * plugins, which are essentially mixins for the Autocrat singleton. 
   * The namespace is used a general storage for plugin related methods and
   * information
   *
   * @name constitution
   * @namespace
   */ constitution . serveAutocrat ( this ) ; Ward . serveAutocrat ( this ) ; this . Ward = Ward ; Advisor . serveAutocrat ( this ) ; this . Advisor = Advisor ; Governor . serveAutocrat ( this ) ; this . Governor = Governor ; Domain . serveAutocrat ( this ) ; this . Domain = Domain ; Law . serveAutocrat ( this ) ; this . Law = Law ; }
Constructs a singleton and namespace.
All Autocrat plugins attach their functionality to the returned instance before
the below listed aspects of the singleton are initialized. Plugins therefore
have an early opportunity to augment the singleton.

* [surveillance](https://github.com/AutocratJS/autocrat/wiki/Surveillance) —
coordinates and provides methods for observation of state-related activity
* [constitution](https://github.com/AutocratJS/autocrat/wiki/The-Autocrat-Constitution-\(aka-Plugins\))
— extra powers given to the Autocrat (plugins basically)
* [wards](https://github.com/AutocratJS/autocrat/wiki/Wards)
— have a bidirectional relationship to the Autocrat singleton, e.g. app.state.ward.router and router.autocrat
* [advisors](https://github.com/AutocratJS/autocrat/wiki/Advisors) — produce Bacon event streams for coordination via laws within governors
* [governors](https://github.com/AutocratJS/autocrat/wiki/Governors) — define laws and methods that mutate state members of domains
* [domains](https://github.com/AutocratJS/autocrat/wiki/Domains) — define how to handle batched change events for given domains, e.g. re-render when the "view" domain changes
* [laws](https://github.com/AutocratJS/autocrat/wiki/Laws) — define the side effects to occur in response to advisor events

__More details__ about [the Autocrat singleton](https://github.com/AutocratJS/autocrat/wiki/The-Autocrat-Singleton)…

@class
@param {Object} options Configuration options
@param {Object} options.wards Object key is used as the member name. Example: key "router" becomes app.state.wards.router
@example
// Instantiating the singleton
// ===========================

// Routers aren't unsually available at Autocrat definition time
var router = new Router();

In order to have dev tools console access to the Autocrat instance
export it to a global variable (not ideal) or as a member of an application
global namespace (better).
app.state = new Autocrat({
wards: {
// This will add a .autocrat member to the router instance, as well
// as making the router instance available at app.state.wards.router
router: router
}
});
Constructs a singleton and namespace . All Autocrat plugins attach their functionality to the returned instance before the below listed aspects of the singleton are initialized . Plugins therefore have an early opportunity to augment the singleton .