For performance reasons, we have decided to let init, update and view run on whatever thread the message was dispatched from. This is because the MVU functions don't access the UI itself, Fabulous deals with it exclusively during reconcilation so we only synchronize back to the UI thread during diffing to avoid the perf hit of jumping threads.
But if we need to access some information related to the UI inside the view function (such as the safe area margins), it requires access to the UI thread, otherwise it could crash.
This PR ensures that the view function is called only on the UI thread to avoid those issues.
For performance reasons, we have decided to let
init
,update
andview
run on whatever thread the message was dispatched from. This is because the MVU functions don't access the UI itself, Fabulous deals with it exclusively during reconcilation so we only synchronize back to the UI thread during diffing to avoid the perf hit of jumping threads.But if we need to access some information related to the UI inside the
view
function (such as the safe area margins), it requires access to the UI thread, otherwise it could crash.This PR ensures that the view function is called only on the UI thread to avoid those issues.