Skip to content

Commit

Permalink
Change method name from invoke to emit
Browse files Browse the repository at this point in the history
  • Loading branch information
uniumuniu committed Oct 11, 2023
1 parent e64b04d commit 2f84b14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/featurevisor/sdk/Emitter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Emitter {
listeners.clear()
}

operator fun invoke(event: EventName) {
fun emit(event: EventName) {
listeners.getOrDefault(event, null)?.invoke()
}
}
6 changes: 3 additions & 3 deletions src/test/kotlin/com/featurevisor/sdk/EmitterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class EmitterTest {
systemUnderTest.addListener(ACTIVATION, activationCallback)

values().forEach {
systemUnderTest.invoke(it)
systemUnderTest.emit(it)
}

verify(exactly = 1) {
Expand All @@ -54,7 +54,7 @@ class EmitterTest {

systemUnderTest.removeListener(REFRESH)
values().forEach {
systemUnderTest.invoke(it)
systemUnderTest.emit(it)
}

verify(exactly = 1) {
Expand All @@ -75,7 +75,7 @@ class EmitterTest {

systemUnderTest.removeAllListeners()
values().forEach {
systemUnderTest.invoke(it)
systemUnderTest.emit(it)
}

verify(exactly = 0) {
Expand Down

0 comments on commit 2f84b14

Please sign in to comment.