-
Notifications
You must be signed in to change notification settings - Fork 24
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
Posting dynamic type message to Web Worker. #242
Comments
Dart |
A follow up on js interop. How can I define list of any type inside interop definiftion? |
|
I am sending dartMap.jsify() to web workers and getting back JS object from web worker. I am expecting my Map data to be What is the better way to type convert this? |
Right, the generic cast will fail because the type parameters are just final map = (original.jsify().dartify() as Map).cast<String, List>();
for (final key in map.keys()) {
final list = map[key].cast<String>();
...
} If you want to avoid that extra iteration, you can manually convert the map yourself using interop (which will be faster), but that'll require more code. |
I have written dart side post message to send dart Map to web worker postMessage.
But
toJsBox
creates an empty object without the actual Map data I want to send.Let me know how can I send dart Map to postMessage without using json encoding.
The text was updated successfully, but these errors were encountered: