1 #pragma once 2 3 #include <jsi/jsi.h> 4 #include <string> 5 #include <utility> 6 7 using namespace facebook; 8 9 namespace reanimated { 10 11 class EventHandlerRegistry; 12 13 class WorkletEventHandler { 14 friend EventHandlerRegistry; 15 16 private: 17 unsigned long id; 18 std::string eventName; 19 jsi::Function handler; 20 21 public: WorkletEventHandler(unsigned long id,std::string eventName,jsi::Function && handler)22 WorkletEventHandler( 23 unsigned long id, 24 std::string eventName, 25 jsi::Function &&handler) 26 : id(id), eventName(eventName), handler(std::move(handler)) {} 27 void process(jsi::Runtime &rt, const jsi::Value &eventValue); 28 }; 29 30 } // namespace reanimated 31