mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
Fabric: Simplified relationship between RawEvent and EventEmitter
Summary: Instead of relying on explicit `RawEventDispatchable` function, we simply check the existence of the `weak_ptr` to `EventTarget`. This is efficient and sufficient because only an EventEmitter retains an associated EventTarget. Reviewed By: mdvacca Differential Revision: D9764858 fbshipit-source-id: 4ac25d925f189d0f8b9002e52388fd51629934a8
This commit is contained in:
committed by
Facebook Github Bot
parent
b6e42517e5
commit
93dd790cad
@@ -13,17 +13,11 @@ namespace react {
|
||||
RawEvent::RawEvent(
|
||||
std::string type,
|
||||
folly::dynamic payload,
|
||||
WeakEventTarget eventTarget,
|
||||
RawEventDispatchable isDispatchable
|
||||
WeakEventTarget eventTarget
|
||||
):
|
||||
type(std::move(type)),
|
||||
payload(std::move(payload)),
|
||||
eventTarget(std::move(eventTarget)),
|
||||
isDispatchable_(std::move(isDispatchable)) {}
|
||||
|
||||
bool RawEvent::isDispatchable() const {
|
||||
return isDispatchable_();
|
||||
}
|
||||
eventTarget(std::move(eventTarget)) {}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
Reference in New Issue
Block a user