Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "AndroidEventBeat.h"
#include "ComponentFactory.h"
#include "EventBeatManager.h"
#include "EventEmitterWrapper.h"
#include "FabricMountingManager.h"

#include <cxxreact/TraceSection.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void EventQueueProcessor::flushEvents(
return ReactEventPriority::Discrete;
case RawEvent::Category::Continuous:
return ReactEventPriority::Continuous;
case RawEvent::Category::Idle:
return ReactEventPriority::Idle;
case RawEvent::Category::Unspecified:
return hasContinuousEventStarted_ ? ReactEventPriority::Continuous
: ReactEventPriority::Default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ struct RawEvent {
* Forces continuous type for the event. Regardless if continuous event
* isn't ongoing.
*/
Continuous = 4
Continuous = 4,

/*
* Priority for events that can be processed in idle times or in the
* background.
*/
Idle = 5,
};

RawEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ enum class ReactEventPriority {
* scrolling.
*/
Continuous,

/*
* Other events that can be processed in the background.
*/
Idle,
};

static constexpr std::underlying_type<ReactEventPriority>::type serialize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,14 @@ jsi::Value UIManagerBinding::get(
return {serialize(ReactEventPriority::Discrete)};
}

if (methodName == "unstable_ContinuousEventPriority") {
return {serialize(ReactEventPriority::Continuous)};
}

if (methodName == "unstable_IdleEventPriority") {
return {serialize(ReactEventPriority::Idle)};
}

if (methodName == "findShadowNodeByTag_DEPRECATED") {
auto paramCount = 1;
return jsi::Function::createFromHostFunction(
Expand Down