1 // Copyright 2022-present 650 Industries. All rights reserved. 2 3 #pragma once 4 5 #ifdef __cplusplus 6 7 #include <react/renderer/components/view/ViewEventEmitter.h> 8 #include <jsi/jsi.h> 9 10 namespace react = facebook::react; 11 12 namespace expo { 13 14 class ExpoViewEventEmitter : public facebook::react::ViewEventEmitter { 15 public: 16 using ViewEventEmitter::ViewEventEmitter; 17 using Shared = std::shared_ptr<const ExpoViewEventEmitter>; 18 19 /** 20 Dispatches an event to send from the native view to JavaScript. 21 This is basically exposing `dispatchEvent` from `facebook::react::EventEmitter` for public use. 22 */ 23 void dispatch(std::string eventName, react::ValueFactory payloadFactory) const; 24 }; 25 26 } // namespace expo 27 28 #endif // __cplusplus 29