cashapp / molecule

Build a StateFlow stream using Jetpack Compose
https://cashapp.github.io/molecule/docs/1.x/
Apache License 2.0
1.79k stars 77 forks source link

Allow an optional CoroutineContext to be supplied to launchMolecule. #312

Closed ghost closed 8 months ago

ghost commented 9 months ago

Allow an optional CoroutineContext to be supplied to launchMolecule.

This allows easier control of what dispatcher Molecule should run under in cases where we can't presume it's wired correctly in the provided CoroutineScope.

waylon-brown commented 9 months ago

Can we write a test? You can add an arbitrary key to the context and assert it's present in the composition for something that works on all platforms.

Added a test, and this also required an additional change here since the test made me aware I wasn't using the passed in context for the Recomposer.

oldergod commented 9 months ago

Just in case, you might want to rebase on master for the apiDump task would fail otherwise after merge

ghost commented 9 months ago

Just in case, you might want to rebase on master for the apiDump task would fail otherwise after merge

Rebased onto master.