MustRegister registers the jsvm plugin in the provided app instance and panics if it fails. Example usage: jsvm.MustRegister(app, jsvm.Config{ OnInit: func(vm *goja.Runtime) { // register custom bindings vm.Set("myCustomVar", 123) }, })
(app core.App, config Config)
| 119 | // }, |
| 120 | // }) |
| 121 | func MustRegister(app core.App, config Config) { |
| 122 | if err := Register(app, config); err != nil { |
| 123 | panic(err) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | // Register registers the jsvm plugin in the provided app instance. |
| 128 | func Register(app core.App, config Config) error { |