`State` objects are just garbage collected when al...
# compose
j
State
objects are just garbage collected when all references are dropped, just like normal objects, there is nothing special. Compose knows about state objects and is able to treat them more intelligently (to recompose when things update, to handle skipping better, etc), so that's why it's good to use them with Compose. State objects do not (yet) support many of the more interesting properties (like liveness) of libraries like Flow and are thus perhaps not advisable for usage in the data layers of your app, although there is nothing "wrong" if you were to do so and you're sure they meet your use cases. That sentence is just to communicate intended usage, but ultimately you will need to evaluate any solution and make your own decisions based on the needs of your app.