forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert RCTModernEventEmitter (facebook#48466)
Summary: Pull Request resolved: facebook#48466 # Changelog: [Internal] - As in the title. Differential Revision: D67793108
- Loading branch information
1 parent
6abcca8
commit c3490b8
Showing
5 changed files
with
60 additions
and
68 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
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
39 changes: 0 additions & 39 deletions
39
...ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...e/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.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,37 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.uimanager.events | ||
|
||
import com.facebook.react.bridge.WritableMap | ||
|
||
/** | ||
* This is a transitional replacement for [RCTEventEmitter] that works with Fabric and non-Fabric | ||
* renderers. [RCTEventEmitter] works with Fabric as well, but there are negative perf implications | ||
* and it should be avoided. | ||
* | ||
* This interface will *also* be deleted in the distant future and be replaced with a new interface | ||
* that doesn't need the old `receiveEvent` method at all. But for the foreseeable future, this is | ||
* the recommended interface to use for EventEmitters. | ||
*/ | ||
@Suppress("DEPRECATION") | ||
public interface RCTModernEventEmitter : RCTEventEmitter { | ||
public fun receiveEvent(surfaceId: Int, targetTag: Int, eventName: String, params: WritableMap?) | ||
|
||
public fun receiveEvent( | ||
surfaceId: Int, | ||
targetTag: Int, | ||
eventName: String, | ||
canCoalesceEvent: Boolean, | ||
customCoalesceKey: Int, | ||
params: WritableMap?, | ||
@EventCategoryDef category: Int | ||
) | ||
|
||
@Deprecated("Dispatch the TouchEvent using [EventDispatcher] instead") | ||
public fun receiveTouches(event: TouchEvent) | ||
} |
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