TurboModule::emitDeviceEvent doesn't require jsi::Runtime argument anymore (#43376)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43376

## Changelog:
[Internal] -

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903

fbshipit-source-id: 25cea413e66c6e76c958395879db1169899e3bc9
This commit is contained in:
Ruslan Shestopalyuk
2024-03-08 10:28:45 -08:00
committed by Facebook GitHub Bot
parent 76ce789014
commit 6c28c87c4d
3 changed files with 9 additions and 3 deletions
@@ -184,7 +184,6 @@ void NativeCxxModuleExample::emitCustomDeviceEvent(
// Test emitting device events (RCTDeviceEventEmitter.emit) from C++
// TurboModule with arbitrary arguments
emitDeviceEvent(
rt,
eventName.utf8(rt).c_str(),
[](jsi::Runtime& rt, std::vector<jsi::Value>& args) {
args.emplace_back(jsi::Value(true));