RCTReloadCommand.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <Foundation/Foundation.h>
  8. #import <React/RCTDefines.h>
  9. /**
  10. * A protocol which should be conformed to in order to be notified of RN reload events. These events can be
  11. * created by CMD+R or dev menu during development, or anywhere the trigger is exposed to JS.
  12. * The listener must also register itself using the method below.
  13. */
  14. @protocol RCTReloadListener
  15. - (void)didReceiveReloadCommand;
  16. @end
  17. /**
  18. * Registers a weakly-held observer of RN reload events.
  19. */
  20. RCT_EXTERN void RCTRegisterReloadCommandListener(id<RCTReloadListener> listener);
  21. /**
  22. * Triggers a reload for all current listeners. Replaces [_bridge reload].
  23. */
  24. RCT_EXTERN void RCTTriggerReloadCommandListeners(NSString *reason);
  25. /**
  26. * This notification fires anytime RCTTriggerReloadCommandListeners() is called.
  27. */
  28. RCT_EXTERN NSString *const RCTTriggerReloadCommandNotification;
  29. RCT_EXTERN NSString *const RCTTriggerReloadCommandReasonKey;
  30. RCT_EXTERN NSString *const RCTTriggerReloadCommandBundleURLKey;
  31. RCT_EXTERN void RCTReloadCommandSetBundleURL(NSURL *URL);