hunk.code_window:   inline fun onCreate(crossinline body: () -> Unit) {
       eventListeners[EventName.MODULE_CREATE] = BasicEventListener(EventName.MODULE_CREATE) { body() }
     }
     inline fun onDestroy(crossinline body: () -> Unit) {
       eventListeners[EventName.MODULE_DESTROY] = BasicEventListener(EventName.MODULE_DESTROY) { body() }
     }
  
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit:   /**
      * Creates module's lifecycle listener that is called when the module is about to be deallocated.
      */
  
hunk.file_path: packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/modules/ModuleDefinitionBuilder.kt
hunk.type: add
file: /*
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  #pragma once
  
  #include <ABI43_0_0React/ABI43_0_0renderer/core/ConcreteComponentDescriptor.h>
  #include <ABI43_0_0React/ABI43_0_0renderer/core/LayoutConstraints.h>
  #include <ABI43_0_0React/ABI43_0_0utils/ContextContainer.h>
  
  namespace ABI43_0_0facebook {
  namespace ABI43_0_0React {
  
  class AndroidSwitchMeasurementsManager {
   public:
    AndroidSwitchMeasurementsManager(
        const ContextContainer::Shared &contextContainer)
        : contextContainer_(contextContainer) {}
  
    Size measure(SurfaceId surfaceId, LayoutConstraints layoutConstraints) const;
  
   private:
    const ContextContainer::Shared contextContainer_;
    mutable std::mutex mutex_;
    mutable bool hasBeenMeasured_ = false;
    mutable Size cachedMeasurement_{};
  };
  
  } // namespace ABI43_0_0React
  } // namespace ABI43_0_0facebook
  