-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use EventDispatcher (#253)
- Loading branch information
Showing
5 changed files
with
114 additions
and
27 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
android/src/main/java/com/turboimage/events/CompletionEvent.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.turboimage.events | ||
|
||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class CompletionEvent(surfaceId: Int, viewId: Int, private val payload: WritableMap): | ||
Event<CompletionEvent>(surfaceId, viewId) { | ||
override fun getEventName(): String { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun getEventData() = payload | ||
|
||
companion object { | ||
const val EVENT_NAME = "onCompletion" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
android/src/main/java/com/turboimage/events/FailureEvent.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.turboimage.events | ||
|
||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class FailureEvent(surfaceId: Int, viewId: Int, private val payload: WritableMap): | ||
Event<FailureEvent>(surfaceId, viewId) { | ||
override fun getEventName(): String { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun getEventData() = payload | ||
|
||
companion object { | ||
const val EVENT_NAME = "onFailure" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.turboimage.events | ||
|
||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class StartEvent(surfaceId: Int, viewId: Int, private val payload: WritableMap): | ||
Event<StartEvent>(surfaceId, viewId) { | ||
override fun getEventName(): String { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun getEventData() = payload | ||
|
||
companion object { | ||
const val EVENT_NAME = "onStart" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
android/src/main/java/com/turboimage/events/SuccessEvent.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.turboimage.events | ||
|
||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class SuccessEvent(surfaceId: Int, viewId: Int, private val payload: WritableMap): | ||
Event<SuccessEvent>(surfaceId, viewId) { | ||
override fun getEventName(): String { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun getEventData() = payload | ||
|
||
companion object { | ||
const val EVENT_NAME = "onSuccess" | ||
} | ||
} |