Generic solution for live editing
Summary: Preparation for making components live editable Reviewed By: kevin0571 Differential Revision: D16379961 fbshipit-source-id: d0ea3d753eb588fe7b55f2345124427b4a5a58b5
This commit is contained in:
committed by
Facebook Github Bot
parent
cb374ffccd
commit
f2bc5d3fb2
@@ -213,11 +213,13 @@
|
||||
NSString *dotJoinedPath = [path componentsJoinedByString: @"."];
|
||||
SKNodeUpdateData updateDataForPath = [[descriptor dataMutationsForNode: node] objectForKey: dotJoinedPath];
|
||||
if (updateDataForPath != nil) {
|
||||
const auto identifierForInvalidation = [descriptor identifierForInvalidation:node];
|
||||
id nodeForInvalidation = [_trackedObjects objectForKey:identifierForInvalidation];
|
||||
SKNodeDescriptor *descriptorForInvalidation = [_descriptorMapper descriptorForClass:[nodeForInvalidation class]];
|
||||
NSMutableArray *children = [self getChildrenForNode:nodeForInvalidation withDescriptor:descriptorForInvalidation];
|
||||
updateDataForPath(value);
|
||||
|
||||
NSMutableArray *children = [self getChildrenForNode:node withDescriptor:descriptor];
|
||||
[connection send: @"invalidate" withParams: @{
|
||||
@"nodes": @[@{@"id": [descriptor identifierForNode: node], @"children": children}]
|
||||
@"nodes": @[@{@"id": [descriptorForInvalidation identifierForNode: nodeForInvalidation], @"children": children}]
|
||||
}];
|
||||
}
|
||||
}
|
||||
@@ -446,9 +448,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (! [_trackedObjects objectForKey: objectIdentifier]) {
|
||||
[_trackedObjects setObject:object forKey:objectIdentifier];
|
||||
}
|
||||
[_trackedObjects setObject:object forKey:objectIdentifier];
|
||||
|
||||
return objectIdentifier;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user