Skip to content

add comment explaining why addListener and removeListeners are not needed #52062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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 @@ -56,7 +56,9 @@ void AnimatedModule::updateAnimatedNodeConfig(
jsi::Runtime& rt,
Tag tag,
jsi::Object config) {
// TODO(T196513045): missing implementation
// TODO(T196513045): missing implementation. This API is only used by Animated
// when PlatformColor API is used and animation is updated with a new value
// through AnimatedColor.setValue.
}

void AnimatedModule::getValue(
Expand Down Expand Up @@ -191,11 +193,15 @@ void AnimatedModule::removeAnimatedEventFromView(
void AnimatedModule::addListener(
jsi::Runtime& /*rt*/,
const std::string& /*eventName*/) {
// TODO(T225953415): missing implementation
// Not needed in C++ Animated. addListener is used to synchronise event
// animations like onScroll with React and Fabric. However C++ Animated
// synchronises with Fabric directly.
}

void AnimatedModule::removeListeners(jsi::Runtime& /*rt*/, int /*count*/) {
// TODO(T225953457): missing implementation
// Not needed in C++ Animated. removeListeners is used to synchronise event
// animations like onScroll with React and Fabric. However C++ Animated
// synchronises with Fabric directly.
}

void AnimatedModule::queueAndExecuteBatchedOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ std::optional<double> NativeAnimatedNodesManager::getValue(Tag tag) noexcept {
}
}

// graph
#pragma mark - Graph

std::unique_ptr<AnimatedNode> NativeAnimatedNodesManager::animatedNode(
Tag tag,
Expand Down Expand Up @@ -235,7 +235,7 @@ void NativeAnimatedNodesManager::dropAnimatedNode(Tag tag) noexcept {
animatedNodes_.erase(tag);
}

// mutations
#pragma mark - Mutations

void NativeAnimatedNodesManager::setAnimatedNodeValue(Tag tag, double value) {
if (auto node = getAnimatedNode<ValueAnimatedNode>(tag)) {
Expand Down Expand Up @@ -280,7 +280,7 @@ void NativeAnimatedNodesManager::stopAnimationsForNode(Tag nodeTag) {
}
}

// drivers
#pragma mark - Drivers

void NativeAnimatedNodesManager::startAnimatingNode(
int animationId,
Expand Down Expand Up @@ -701,7 +701,8 @@ bool NativeAnimatedNodesManager::isOnRenderThread() const noexcept {
return isOnRenderThread_;
}

// listeners
#pragma mark - Listeners

void NativeAnimatedNodesManager::startListeningToAnimatedNodeValue(
Tag tag,
ValueListenerCallback&& callback) noexcept {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class NativeAnimatedNodesManager {

std::optional<double> getValue(Tag tag) noexcept;

// graph
#pragma mark - Graph

void createAnimatedNode(Tag tag, const folly::dynamic& config) noexcept;

Expand All @@ -102,7 +102,7 @@ class NativeAnimatedNodesManager {

void setAnimatedNodeOffset(Tag tag, double offset);

// drivers
#pragma mark - Drivers

void startAnimatingNode(
int animationId,
Expand All @@ -127,7 +127,8 @@ class NativeAnimatedNodesManager {
std::shared_ptr<EventEmitterListener> getEventEmitterListener() noexcept {
return ensureEventEmitterListener();
}
// listeners

#pragma mark - Listeners

void startListeningToAnimatedNodeValue(
Tag tag,
Expand Down
Loading