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
35 lines
684 B
C++
35 lines
684 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.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <folly/dynamic.h>
|
|
#include <jsi/jsi.h>
|
|
#include <react/events/primitives.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* Represents ready-to-dispatch event object.
|
|
*/
|
|
class RawEvent {
|
|
public:
|
|
RawEvent(
|
|
std::string type,
|
|
ValueFactory payloadFactory,
|
|
WeakEventTarget eventTarget);
|
|
|
|
const std::string type;
|
|
const ValueFactory payloadFactory;
|
|
const WeakEventTarget eventTarget;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|