MCPcopy
hub / github.com/hotwired/stimulus / constructor

Method constructor

src/core/context.ts:23–38  ·  view source on GitHub ↗
(module: Module, scope: Scope)

Source from the content-addressed store, hash-verified

21 private outletObserver: OutletObserver
22
23 constructor(module: Module, scope: Scope) {
24 this.module = module
25 this.scope = scope
26 this.controller = new module.controllerConstructor(this)
27 this.bindingObserver = new BindingObserver(this, this.dispatcher)
28 this.valueObserver = new ValueObserver(this, this.controller)
29 this.targetObserver = new TargetObserver(this, this)
30 this.outletObserver = new OutletObserver(this, this)
31
32 try {
33 this.controller.initialize()
34 this.logDebugActivity("initialize")
35 } catch (error: any) {
36 this.handleError(error, "initializing controller")
37 }
38 }
39
40 connect() {
41 this.bindingObserver.start()

Callers

nothing calls this directly

Calls 2

handleErrorMethod · 0.95
initializeMethod · 0.45

Tested by

no test coverage detected