mirror of
https://github.com/status-im/react-native.git
synced 2025-01-17 13:01:13 +00:00
beb3fcda34
Summary: This is the first attempt to implement some base part of event dispatching pipeline from end-to-end. Even when it is working, all this is still incomplete and generally up in the air. We are still messing proper implementation of event queue, priority, and synchronization of react reconciliation process with event scheduling. Reviewed By: fkgozali Differential Revision: D8212271 fbshipit-source-id: 92f9427d14726441c70ffff294ac95eeb004152a
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* 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 <fabric/core/ReactPrimitives.h>
|
|
#include <fabric/core/EventPrimitives.h>
|
|
#include <folly/dynamic.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class EventDispatcher;
|
|
|
|
using SharedEventDispatcher = std::shared_ptr<const EventDispatcher>;
|
|
|
|
/*
|
|
* Abstract class that represent event-delivery infrastructure.
|
|
* Particular `EventHandlers` clases use an object of this class to invoke
|
|
* events.
|
|
*/
|
|
class EventDispatcher {
|
|
|
|
public:
|
|
|
|
virtual EventTarget createEventTarget(const InstanceHandle &instanceHandle) const = 0;
|
|
|
|
virtual void releaseEventTarget(const EventTarget &eventTarget) const = 0;
|
|
|
|
/*
|
|
* Dispatches "raw" event using some event-delivery infrastructure.
|
|
*/
|
|
virtual void dispatchEvent(
|
|
const EventTarget &eventTarget,
|
|
const std::string &type,
|
|
const folly::dynamic &payload,
|
|
const EventPriority &priority
|
|
) const = 0;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|