Last active
September 19, 2022 09:26
-
-
Save ibrahimsn98/ab1bc9c48dfdd96d61ba2dcc563365ff to your computer and use it in GitHub Desktop.
ty-demeter-blog-7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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