mirror of
https://github.com/status-im/react-native.git
synced 2025-01-18 13:31:18 +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
52 lines
1.2 KiB
C++
52 lines
1.2 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 <fabric/core/EventDispatcher.h>
|
|
#include <fabric/core/EventPrimitives.h>
|
|
#include <fabric/uimanager/FabricUIManager.h>
|
|
#include <folly/dynamic.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class SchedulerEventDispatcher;
|
|
|
|
using SharedSchedulerEventDispatcher = std::shared_ptr<const SchedulerEventDispatcher>;
|
|
|
|
/*
|
|
* Concrete EventDispatcher.
|
|
*/
|
|
class SchedulerEventDispatcher final:
|
|
public EventDispatcher {
|
|
|
|
public:
|
|
|
|
void setUIManager(std::shared_ptr<const FabricUIManager> uiManager);
|
|
|
|
#pragma mark - EventDispatcher
|
|
|
|
EventTarget createEventTarget(const InstanceHandle &instanceHandle) const override;
|
|
|
|
void releaseEventTarget(const EventTarget &eventTarget) const override;
|
|
|
|
void dispatchEvent(
|
|
const EventTarget &eventTarget,
|
|
const std::string &type,
|
|
const folly::dynamic &payload,
|
|
const EventPriority &priority
|
|
) const override;
|
|
|
|
private:
|
|
|
|
std::shared_ptr<const FabricUIManager> uiManager_;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|