Skip to content

Commit

Permalink
refactor: added jsi folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Makowski committed Dec 12, 2024
1 parent 0648b0b commit dcf2e4f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/react-native-audio-api/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ file(GLOB_RECURSE SOURCE_FILES
"../common/cpp/HostObjects/*.h"
"../common/cpp/utils/*.cpp"
"../common/cpp/utils/*.h"
"../common/cpp/jsi/*.h"
"../common/cpp/jsi/*.cpp"
"../common/cpp/types/*.h"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace audioapi {
using namespace facebook;

jsi::Value PromiseVendor::createPromise(
std::function<void(std::shared_ptr<Promise>)> func) {
const std::function<void(std::shared_ptr<Promise>)>& func) {
if (_runtime == nullptr) {
throw new std::runtime_error("Runtime was null!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Promise {
std::function<void(const std::string &)> reject)
: _resolve(std::move(resolve)), _reject(std::move(reject)) {}

bool isResolved;
void resolve(jsi::Value &&value) {
_resolve(std::forward<jsi::Value>(value));
}
Expand All @@ -38,7 +37,7 @@ class PromiseVendor {
: _runtime(runtime), _callInvoker(callInvoker) {}

public:
jsi::Value createPromise(std::function<void(std::shared_ptr<Promise>)> func);
jsi::Value createPromise(const std::function<void(std::shared_ptr<Promise>)>& func);

private:
jsi::Runtime *_runtime;
Expand Down

0 comments on commit dcf2e4f

Please sign in to comment.