Open IVIanuu opened 7 months ago
How do we do that for the one which returns a StateFlow?
Oh sorry, this makes sense. I only used the overload with the emitter.
We're currently modeled after the Compose APIs which don't offer a job. The best way to get one today is to create a new scope with a dedicated job on which you call launchMolecule.
I would like to return a job, but the StateFlow-returning overload becomes annoying.
This is what i'm doing now, thank you.
I still might make this change for the emitter-based one. We actually were just talking about it internally early last week, coincidentally. For the StateFlow
-returning one I could accept a nullable Job
, perhaps, as a way to get a handle. Will think about it.
It would be nice if launchMolecule would return a Job object to easily cancel it.