1 #pragma once
2 
3 #include <jsi/jsi.h>
4 #include <memory>
5 #include <string>
6 
7 using namespace facebook;
8 
9 namespace reanimated {
10 
11 struct HostFunctionHandler : jsi::HostObject {
12   std::shared_ptr<jsi::Function> pureFunction;
13   std::string functionName;
14   jsi::Runtime *hostRuntime;
15   jsi::HostObject a;
16 
HostFunctionHandlerHostFunctionHandler17   HostFunctionHandler(std::shared_ptr<jsi::Function> f, jsi::Runtime &rt) {
18     pureFunction = f;
19     functionName = f->getProperty(rt, "name").asString(rt).utf8(rt);
20     hostRuntime = &rt;
21   }
22 
getPureFunctionHostFunctionHandler23   std::shared_ptr<jsi::Function> getPureFunction() {
24     return pureFunction;
25   }
26 };
27 
28 } // namespace reanimated
29