zserge / lorca

Build cross-platform modern desktop apps in Go + HTML5
MIT License
8.04k stars 535 forks source link

Add possibility to overwrite an already existing binding. #67

Closed aligator closed 5 years ago

aligator commented 5 years ago

Add possibility to overwrite an already existing binding.

I have the case that my application has different modules and I can load and unload each module. On each load the bindings may change to a different struct-reference and therefore I add these bindings again. But this produced a wired error because the binding-js is added again to the page.

Now I just add the js once and only change the callback if there was already one.