-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Helpful tip for childSlot #712
Comments
There are already main thread checks implemented. Could you please elaborate? |
Perhaps, we could an additional main thread check. Btw, your first code snippet has a mistake. Please don't use |
In case #1, I indeed have a main thread check and an error message is thrown. However, the error message did not specifically mention that val state: Value<ChildSlot<...>> = childSlot(...) cannot be used on a background thread. The problem is that while there is a main thread check, it does not explicitly indicate that childSlot must be run on the main thread in error. Therefore, I suggest that a main thread check should be performed inside the childSlot method and an exception should be thrown accordingly. This would be very user-friendly. |
Ok, so the actual issue is because the property is accessed on a background thread. It makes sense to add the additional check. Thanks for raising. |
I have an idea for this project.
when call childSlot in Dispatcher.IO before。check current Thread==''main''
This is helpful to resolve bug faster!
The text was updated successfully, but these errors were encountered: