From 858824c08be459109c3213517c812472ea24f66b Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 22 Nov 2019 20:05:04 -0800 Subject: [PATCH] Fabric: Fixing event priority propagation in ConcreteState Summary: Two changes: * Now we pass the given `priority` to the next function; * The default value for `updateState` is now the same as a default value in another overload of the same function (AsynchronousBatched). All that don't change anything for now because sync event dispatching is disabled (that will matter bit later thought). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D18607655 fbshipit-source-id: 9dc7cdac9f347e09449a931c780e613925882a1e --- ReactCommon/fabric/core/state/ConcreteState.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/core/state/ConcreteState.h b/ReactCommon/fabric/core/state/ConcreteState.h index 262599aa713..86d5d1c0ab7 100644 --- a/ReactCommon/fabric/core/state/ConcreteState.h +++ b/ReactCommon/fabric/core/state/ConcreteState.h @@ -52,11 +52,12 @@ class ConcreteState : public State { */ void updateState( Data &&newData, - EventPriority priority = EventPriority::SynchronousUnbatched) const { + EventPriority priority = EventPriority::AsynchronousUnbatched) const { updateState( [data = std::move(newData)](const Data &oldData) mutable -> Data && { return std::move(data); - }); + }, + priority); } /*