You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 30, 2019. It is now read-only.
If you are making use of a library which only gives you an underlying *gopherjs/js.Object (GopherJS) or syscall/js.Value (WebAssembly) object, it is impossible to use this library with that object.
This is unfortunate because it makes interoperability hard: when you are given one of these underlying objects, you must use those APIs independently rather than being able to make use of this generic library. It means that in order to use this library, you must effectively switch completely to this library first.
I thus propose a way to wrap an existing native object and get back a gopherwasm/js.Value. This would be done by a function whose type signature changes based on a build tag:
Under GopherJS:
// Wrap wraps a *gopherjs/js.Object and returns a Value.//// When compiling under WebAssembly, this function signature instead takes a// syscall/js.Value.funcWrap(object*js.Object) Value
And under WebAssembly:
// Wrap wraps a syscall/js.Value and returns a Value.//// When compiling under WebAssembly, this function signature instead takes a// *gopherjs/js.Object.funcWrap(value js.Value) Value