say for example I have an Activity which does setC...
# compose
o
say for example I have an Activity which does setContent and starts a composable like EventsNavHost (has a NavHost inside and determines where to go from that screen) inside I have Events composable (the actual list of events let’s say) I am passing the callback to this EventsNavHost so that it could pass it to the Events so that it could run it on event clicked, the callback just includes opening another screen with the given event details and whatever, great but I also want it to do something that is right now sitting in the viewModel for the parent activity (the one that EventsNavHost is started from) so you got 1 part of the code i want to pass that opens a new screen, and another that does something that should belong in the viewmodel, how do I pass both to EventsNavHost > Events > onEventCLicked?
this is the code that I want to happen when event is clicked
Copy code
analytics.log(
    AnalyticsEvent.Event.SearchResult.Clicked(
        IdUtil.fromGlobalId(event.id),
        event.title,
        event.typeName.uppercase(Locale.getDefault()),
        category,
        location,
        period,
        event.sharingUrl,
        AnalyticsEvent.Event.SearchResult.Trigger.BrowseEvents
    )
)
and then the starting of another activity
ok so I’m just passing Event model to the callback and inside i start the activity using event id and i send the event to the viewmodel for logging its details