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
Is your feature request related to a problem? Please describe.
It would be nice if wails could optionally generate bindings for go functions that do not return a promise (when no asynchronous operation is performed).
For instance, I have a Go function that converts a number in milliseconds to a string representing a date at my location [The reason why I don't want to do this in JavaScript is that they seem not to be compatible in doing this operation]. I want to call it from the JavaScript code. But this function does not involve any asynchronous
operation like reading from a database, etc. So there in no need of returning a Promise. And doing so, only increases complexity of the JavaScript code and overhead.
Describe the solution you'd like
It would be nice to have something like
// @nopromise
func (a* App) convert_to_date_string( mili int 64) string
The calls to the backend have to be asynchronous regardless of what the binding is doing.
The visual layer and Go code are effectively two different programs. There is the website SPA and a backend API (your bindings).
May i please suggest if you don't want to handle promises with YourMethod.then((result) => { ..do stuff with result... }, (error) => { ...do stuff with error... } ) you access the bindings in an async call. e.g.
Synchronous calls aren't possible due to the underlying technology. I'd use await and if you use it in multiple places then create a sync function that deals with the promise.
Is your feature request related to a problem? Please describe.
It would be nice if wails could optionally generate bindings for go functions that do not return a promise (when no asynchronous operation is performed).
For instance, I have a Go function that converts a number in milliseconds to a string representing a date at my location [The reason why I don't want to do this in JavaScript is that they seem not to be compatible in doing this operation]. I want to call it from the JavaScript code. But this function does not involve any asynchronous
operation like reading from a database, etc. So there in no need of returning a Promise. And doing so, only increases complexity of the JavaScript code and overhead.
Describe the solution you'd like
It would be nice to have something like
// @nopromise
func (a* App) convert_to_date_string( mili int 64) string
The package
https://github.com/MarcGrol/golangAnnotations
might help.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: