External
Rely on some other external system for sending snapshot change notifications.
This should only be used if you can guarantee that someone else is listening to global snapshot writes and sending apply notifications. Usually this means that some other Compose-based system is being used in your application, and that it will always be initialized prior to Molecule or at the same time.
Failure to ensure someone else is sending apply notifications will result in state writes not triggering additional recomposition.
Some examples where this policy can be used:
On Android, using Compose UI before Molecule (e.g., even just calling
setContent { }
on anActivity
orComposeView
) will start a singleton snapshot write listener and applier. If you are sure that this will always happen, specifying this policy for all Molecule launches is valid.On JetBrains' Compose UI for Desktop, calling the
application { }
function is enough to ensure their singleton snapshot write listener and applier is started (you do not have to even show a window).