/* * 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. */ #import #import #import #import "RCTMountingTransactionObserverCoordinator.h" #include class RCTMountingTransactionObserverCoordinator final { public: /* * Registers (and unregisters) specified `componentViewDescriptor` in the * registry of views that need to be notified. Does nothing if a particular * `componentViewDescriptor` does not listen the events. */ void registerViewComponentDescriptor( const RCTComponentViewDescriptor& componentViewDescriptor, facebook::react::SurfaceId surfaceId); void unregisterViewComponentDescriptor( const RCTComponentViewDescriptor& componentViewDescriptor, facebook::react::SurfaceId surfaceId); /* * To be called from `RCTMountingManager`. */ void notifyObserversMountingTransactionWillMount( const facebook::react::MountingTransaction& transaction, const facebook::react::SurfaceTelemetry& surfaceTelemetry) const; void notifyObserversMountingTransactionDidMount( const facebook::react::MountingTransaction& transaction, const facebook::react::SurfaceTelemetry& surfaceTelemetry) const; private: std::unordered_map< facebook::react::SurfaceId, std::unordered_set> registry_; };