Alex Crafford
10/02/2023, 10:31 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 10:32 PMModifier.testTag
for that sort of thingAlex Crafford
10/02/2023, 10:33 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 10:35 PMasTree
and mapTree
methods, you could try that but those are only intended for tooling so i’m not sure how reliable they’ll be for testsAlex Crafford
10/02/2023, 10:36 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 10:37 PMCompositionData
stuff might not work at all? I think some of that data is only generated in debug mode, and even then only when a certain flag is set, and it has a huge performance costAlex Crafford
10/02/2023, 10:41 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 10:42 PMAlex Crafford
10/02/2023, 10:51 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 10:56 PMAlex Crafford
10/02/2023, 10:59 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 11:06 PMAlex Crafford
10/02/2023, 11:22 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 11:23 PM@Composable fun App(analyticsController: AnalyticsController) {
CompositionLocalProvider(LocalAnalyticsController provides analyticsController) {
RestOfApp()
}
}
Alex Crafford
10/02/2023, 11:25 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 11:28 PMLocalAnalyticsController
and AnalyticsController
from your library and ask the consuming app to provide an instance however it likes, or
2. Make LocalAnalyticsController
private, expose AnalyticsController
, and expose a @Composable fun AnalyticsControllerProvider(controller: AnalyticsController)
function that your consuming app must use.
(1) is simpler, and also allows your library consumers to consume the LocalAnalyticsController
which may be good (for flexibility) or bad (if you want to control how it’s used).Alex Crafford
10/02/2023, 11:31 PMZach Klippenstein (he/him) [MOD]
10/02/2023, 11:31 PM