Home / File/ ReactNativeEventEmitter.js — react Source File

ReactNativeEventEmitter.js — react Source File

Architecture documentation for ReactNativeEventEmitter.js, a javascript file in the react codebase. 13 imports, 1 dependents.

File javascript BabelCompiler 13 imports 1 dependents

Entity Profile

Dependency Diagram

graph LR
  baab5855_112a_37e6_6ca7_0813fd6ae027["ReactNativeEventEmitter.js"]
  e7f91ff9_eaf6_39c4_5463_6f4e0e1c075f["PluginModuleType.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> e7f91ff9_eaf6_39c4_5463_6f4e0e1c075f
  b2f450b6_f67a_153d_5efb_a03735431450["ReactSyntheticEventType.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> b2f450b6_f67a_153d_5efb_a03735431450
  304edd67_bb4f_7b82_bbee_3b770742ef97["TopLevelEventTypes.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 304edd67_bb4f_7b82_bbee_3b770742ef97
  6b52f26d_d341_6500_ecb0_54a0747596f4["EventPluginRegistry.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 6b52f26d_d341_6500_ecb0_54a0747596f4
  cb0565f2_ac6f_4c74_0235_a8c5f28c4334["ReactGenericBatching.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> cb0565f2_ac6f_4c74_0235_a8c5f28c4334
  b7455b38_0a5f_98b8_80f7_72b10f1f60c9["batchedUpdates"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> b7455b38_0a5f_98b8_80f7_72b10f1f60c9
  501868ac_ed82_decd_b0b4_e77c7390f910["EventBatching.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 501868ac_ed82_decd_b0b4_e77c7390f910
  206d6e15_9f6a_1db1_9586_33b342b6cf24["runEventsInBatch"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 206d6e15_9f6a_1db1_9586_33b342b6cf24
  5f61475e_65e9_53ee_1eeb_f357a8fb2b93["ReactNativeGetListener.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 5f61475e_65e9_53ee_1eeb_f357a8fb2b93
  2d91c4ed_9a58_6013_5118_49d8f98f9453["getListener"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 2d91c4ed_9a58_6013_5118_49d8f98f9453
  c55ef19d_ffff_0be0_ac25_e6d6c8520cd6["accumulateInto.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> c55ef19d_ffff_0be0_ac25_e6d6c8520cd6
  6558eedc_539e_2a0a_77c0_574f399b3f4a["ReactNativeComponentTree.js"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 6558eedc_539e_2a0a_77c0_574f399b3f4a
  42892443_e223_3da0_aeb9_e1b32a408fb0["ReactInternalTypes"]
  baab5855_112a_37e6_6ca7_0813fd6ae027 --> 42892443_e223_3da0_aeb9_e1b32a408fb0
  dea78bbd_0d4e_27e7_3d5e_51bbb5d31b87["ReactNativeInjection.js"]
  dea78bbd_0d4e_27e7_3d5e_51bbb5d31b87 --> baab5855_112a_37e6_6ca7_0813fd6ae027
  style baab5855_112a_37e6_6ca7_0813fd6ae027 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * 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.
 *
 * @flow
 */

import type {
  AnyNativeEvent,
  LegacyPluginModule,
} from './legacy-events/PluginModuleType';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {ReactSyntheticEvent} from './legacy-events/ReactSyntheticEventType';
import type {TopLevelType} from './legacy-events/TopLevelEventTypes';

import {
  registrationNameModules,
  plugins,
} from './legacy-events/EventPluginRegistry';
import {batchedUpdates} from './legacy-events/ReactGenericBatching';
import {runEventsInBatch} from './legacy-events/EventBatching';
import getListener from './ReactNativeGetListener';
import accumulateInto from './legacy-events/accumulateInto';

import {getInstanceFromNode} from './ReactNativeComponentTree';

export {getListener, registrationNameModules as registrationNames};

/**
 * Version of `ReactBrowserEventEmitter` that works on the receiving side of a
 * serialized worker boundary.
 */

// Shared default empty native event - conserve memory.
const EMPTY_NATIVE_EVENT = (({}: any): AnyNativeEvent);

/**
 * Selects a subsequence of `Touch`es, without destroying `touches`.
 *
 * @param {Array<Touch>} touches Deserialized touch objects.
 * @param {Array<number>} indices Indices by which to pull subsequence.
 * @return {Array<Touch>} Subsequence of touch objects.
 */
// $FlowFixMe[missing-local-annot]
function touchSubsequence(touches, indices) {
  const ret = [];
  for (let i = 0; i < indices.length; i++) {
    ret.push(touches[indices[i]]);
  }
  return ret;
}

/**
 * TODO: Pool all of this.
 *
 * Destroys `touches` by removing touch objects at indices `indices`. This is
 * to maintain compatibility with W3C touch "end" events, where the active
 * touches don't include the set that has just been "ended".
// ... (182 more lines)

Domain

Frequently Asked Questions

What does ReactNativeEventEmitter.js do?
ReactNativeEventEmitter.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactNativeEventEmitter.js depend on?
ReactNativeEventEmitter.js imports 13 module(s): EventBatching.js, EventPluginRegistry.js, PluginModuleType.js, ReactGenericBatching.js, ReactInternalTypes, ReactNativeComponentTree.js, ReactNativeGetListener.js, ReactSyntheticEventType.js, and 5 more.
What files import ReactNativeEventEmitter.js?
ReactNativeEventEmitter.js is imported by 1 file(s): ReactNativeInjection.js.
Where is ReactNativeEventEmitter.js in the architecture?
ReactNativeEventEmitter.js is located at packages/react-native-renderer/src/ReactNativeEventEmitter.js (domain: BabelCompiler, directory: packages/react-native-renderer/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free