-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation #21
Comments
Is there an example we can look at in the meantime? |
@MulverineX From these examples it is not clear how one can get the results back from javascript calls. Perhaps with |
final result = evaluateScripts('path.to.function("bar")')` This is how Flutter land issues events to JS land and receives a response back synchronously controller.context.dispatcher?.subscribe('example', (args) {
evaluateScripts(`${args[0]['callback']}('hellooooo')`)
}); let baz = (foo) => console.log(foo)
mercury.dispatcher.dispatch('example', { callback: `baz`}); This is how JS land issues events to Flutter land and receives a response back with a callback (there is no synchronous response mechanism) |
If you would like to have synchronous response from Dart somehow for simpler code, you're welcome to create a feature request issue for that, just keep in mind it won't be a priority, it's more likely it'll be implemented if we receive a PR. Remember that you can wrap callback systems like this with a Promise to make it cleaner in asynchronous functions. |
@MulverineX Thanks a lot!! |
No description provided.
The text was updated successfully, but these errors were encountered: