mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
add comment explaining why addListener and removeListeners are not needed (#52062)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52062 changelog: [internal] - update comments to be more descriptive. - use `#pragma mark -` to better group methods in `NativeAnimatedNodesManager`. It is nicely formatted in VSCode. {F1979345410} Reviewed By: mdvacca Differential Revision: D76737257 fbshipit-source-id: c4b22ca45cd5dec2c72e7931bfec4466cda3070c
This commit is contained in:
1 parent
7bfadb429c
commit
1456d06c86
3 files changed
+18
-10
No files matched your search
@@ -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(
|
||||
@@ -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(
|
||||
|
||||
+5
-4
@@ -87,7 +87,7 @@ std::optional<double> NativeAnimatedNodesManager::getValue(Tag tag) noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
// graph
|
||||
#pragma mark - Graph
|
||||
|
||||
std::unique_ptr<AnimatedNode> NativeAnimatedNodesManager::animatedNode(
|
||||
Tag tag,
|
||||
@@ -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)) {
|
||||
@@ -280,7 +280,7 @@ void NativeAnimatedNodesManager::stopAnimationsForNode(Tag nodeTag) {
|
||||
}
|
||||
}
|
||||
|
||||
// drivers
|
||||
#pragma mark - Drivers
|
||||
|
||||
void NativeAnimatedNodesManager::startAnimatingNode(
|
||||
int animationId,
|
||||
@@ -701,7 +701,8 @@ bool NativeAnimatedNodesManager::isOnRenderThread() const noexcept {
|
||||
return isOnRenderThread_;
|
||||
}
|
||||
|
||||
// listeners
|
||||
#pragma mark - Listeners
|
||||
|
||||
void NativeAnimatedNodesManager::startListeningToAnimatedNodeValue(
|
||||
Tag tag,
|
||||
ValueListenerCallback&& callback) noexcept {
|
||||
|
||||
+4
-3
@@ -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;
|
||||
|
||||
@@ -102,7 +102,7 @@ class NativeAnimatedNodesManager {
|
||||
|
||||
void setAnimatedNodeOffset(Tag tag, double offset);
|
||||
|
||||
// drivers
|
||||
#pragma mark - Drivers
|
||||
|
||||
void startAnimatingNode(
|
||||
int animationId,
|
||||
@@ -127,7 +127,8 @@ class NativeAnimatedNodesManager {
|
||||
std::shared_ptr<EventEmitterListener> getEventEmitterListener() noexcept {
|
||||
return ensureEventEmitterListener();
|
||||
}
|
||||
// listeners
|
||||
|
||||
#pragma mark - Listeners
|
||||
|
||||
void startListeningToAnimatedNodeValue(
|
||||
Tag tag,
|
||||
|
||||
Reference in new issue
Block a user