mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 22:58:19 +00:00
Summary: Now the event delive pipeline supports `JSI::Value`-based payload. Instead of passing `folly::dynamic`, now we are passing `std::function<jsi::Value(jsi::Runtime &runtime)>` as factory that can build a `JSI::Value` with given `jsi::Runtime` and any captured data. The old (now legacy) way of calling `EventEmitter::dispatchEvent(..., const folly::dynamic &payload, ...)` is also supported. Reviewed By: sahrens Differential Revision: D13123043 fbshipit-source-id: d65348bb215013042abb2fcfe5083a8c697333d0
23 lines
530 B
C++
23 lines
530 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "RawEvent.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
RawEvent::RawEvent(
|
|
std::string type,
|
|
ValueFactory payloadFactory,
|
|
WeakEventTarget eventTarget)
|
|
: type(std::move(type)),
|
|
payloadFactory(std::move(payloadFactory)),
|
|
eventTarget(std::move(eventTarget)) {}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|