Skip to content

Instantly share code, notes, and snippets.

@abhaysood
Last active March 30, 2019 17:38
Show Gist options
  • Save abhaysood/1b0521441a28943463d637827bc122af to your computer and use it in GitHub Desktop.
Save abhaysood/1b0521441a28943463d637827bc122af to your computer and use it in GitHub Desktop.
class RootComponent(...) {
val locationSelection = LocationSelectionComponent(...)
fun launchLocationSelection() {
// Create the component
locationSelection = LocationSelectionComponent(...)
// Register callbacks
locationSelection.callbacks = object: LocationSelectionComponent.Callbacks() {
override fun onPickupAndDestinationSelected(pickup: Pickup,
destination: Destination) {
// launch some other component
}
}
// Signal the component to start it's tasks
locationSelection.start()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment