MCPcopy Create free account
hub / github.com/jakesgordon/javascript-state-machine / factory

Function factory

lib/state-machine.js:590–604  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

588}
589
590function factory() {
591 var cstor, options;
592 if (typeof arguments[0] === 'function') {
593 cstor = arguments[0];
594 options = arguments[1] || {};
595 }
596 else {
597 cstor = function() { this._fsm.apply(this, arguments) };
598 options = arguments[0] || {};
599 }
600 var config = new Config(options, StateMachine);
601 build(cstor.prototype, config);
602 cstor.prototype._fsm.config = config; // convenience access to shared config without needing an instance
603 return cstor;
604}
605
606//-------------------------------------------------------------------------------------------------
607

Callers 3

visualize.jsFile · 0.70
history.jsFile · 0.70
state-machine.jsFile · 0.70

Calls 1

buildFunction · 0.70

Tested by

no test coverage detected