From 70d417b62b15c620b89fe32649b96c5b598cf91c Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Mon, 16 Mar 2020 07:24:41 -0700 Subject: [PATCH] Tweak docs for [SKNodeDescriptor -identifierForInvalidation:] Summary: It took me a few tries to understand what this was for. Reviewed By: jknoxville Differential Revision: D20462208 fbshipit-source-id: f6dac7836409c8d4ec1ffb90a74f632624fb68f7 --- .../FlipperKitLayoutPlugin/SKNodeDescriptor.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin/SKNodeDescriptor.h b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin/SKNodeDescriptor.h index c805b8c64..b00289c5e 100644 --- a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin/SKNodeDescriptor.h +++ b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin/SKNodeDescriptor.h @@ -45,9 +45,13 @@ typedef void (^SKNodeUpdateData)(id value); - (NSString*)identifierForNode:(T)node; /** - An ID which is equal between reflowing components is needed to get the - identifier of root node of a tree which need to be invalidated on - FlipperKitLayoutPlugin side. + When the setData command is received from Flipper to change a node's data, + an "invalidateWithData" command is sent back to signal that the node has + changed. However sometimes you may want to invalidate some other node, + not the node that had its data actually modified; usually some ancestor. + This method allows you to substitute another node's identifier. + If you do not override it, the default behavior is to simply return + the node's identifier. */ - (NSString*)identifierForInvalidation:(T)node;