Skip to content

Instantly share code, notes, and snippets.

@ibrahimsn98
Last active September 19, 2022 09:26
Show Gist options
  • Save ibrahimsn98/ab1bc9c48dfdd96d61ba2dcc563365ff to your computer and use it in GitHub Desktop.
Save ibrahimsn98/ab1bc9c48dfdd96d61ba2dcc563365ff to your computer and use it in GitHub Desktop.
ty-demeter-blog-7
class MealDemeterEventDispatcher @Inject constructor(
@MealDemeter private val demeter: Demeter,
) : EventDispatcher {
override fun report(event: Event) {
val eventData = event.getData().analyticsMap[MealEvent.DEMETER] ?: return
...
when (eventGroup) {
EventGroup.SCREEN.id,
EventGroup.CLICK.id -> demeter.sendEvent(
name = eventData.eventName,
group = eventGroup,
screen = screen,
parameters = parameterMap,
)
EventGroup.IMPRESSION.id -> demeter.enqueueEvent(
name = eventData.eventName,
group = eventGroup,
screen = screen,
parameters = parameterMap,
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment