Skip to content

Commit

Permalink
Renaming uiManagerWillFlushUIBlocks -> uiManagerWillPerformMounting
Browse files Browse the repository at this point in the history
Summary:
Because it is not simply flushing, it (in the future) is more complex process. And the names should represent logical meaning of the process, not particular implementation details.
It also nice to have unified terminology across our reactive UI frameworks.

See the next diffs.

Reviewed By: rsnara

Differential Revision: D6436770

fbshipit-source-id: 0a0b686e8ace89e30f6787a37c0a7965c5af757b
  • Loading branch information
shergin authored and facebook-github-bot committed Dec 12, 2017
1 parent ecec431 commit 0a8721c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Libraries/NativeAnimation/RCTNativeAnimatedModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (void)invalidate
- (dispatch_queue_t)methodQueue
{
// This module needs to be on the same queue as the UIManager to avoid
// having to lock `_operations` and `_preOperations` since `uiManagerWillFlushUIBlocks`
// having to lock `_operations` and `_preOperations` since `uiManagerWillPerformMounting`
// will be called from that queue.
return RCTGetUIManagerQueue();
}
Expand Down Expand Up @@ -198,7 +198,7 @@ - (void)addPreOperationBlock:(AnimatedOperation)operation

#pragma mark - RCTUIManagerObserver

- (void)uiManagerWillFlushUIBlocks:(RCTUIManager *)uiManager
- (void)uiManagerWillPerformMounting:(RCTUIManager *)uiManager
{
if (_preOperations.count == 0 && _operations.count == 0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ - (void)_layoutAndMount
}
}];

[_observerCoordinator uiManagerWillFlushUIBlocks:self];
[_observerCoordinator uiManagerWillPerformMounting:self];

[self flushUIBlocks];
}
Expand Down
2 changes: 1 addition & 1 deletion React/Modules/RCTUIManagerObserverCoordinator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* Called before flushing UI blocks at the end of a batch.
* This is called from the UIManager queue. Can be used to add UI operations in that batch.
*/
- (void)uiManagerWillFlushUIBlocks:(RCTUIManager *)manager;
- (void)uiManagerWillPerformMounting:(RCTUIManager *)manager;

@end

Expand Down
6 changes: 3 additions & 3 deletions React/Modules/RCTUIManagerObserverCoordinator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ - (void)uiManagerDidPerformLayout:(RCTUIManager *)manager
}
}

- (void)uiManagerWillFlushUIBlocks:(RCTUIManager *)manager
- (void)uiManagerWillPerformMounting:(RCTUIManager *)manager
{
std::lock_guard<std::mutex> lock(_mutex);

for (id<RCTUIManagerObserver> observer in _observers) {
if ([observer respondsToSelector:@selector(uiManagerWillFlushUIBlocks:)]) {
[observer uiManagerWillFlushUIBlocks:manager];
if ([observer respondsToSelector:@selector(uiManagerWillPerformMounting:)]) {
[observer uiManagerWillPerformMounting:manager];
}
}
}
Expand Down

0 comments on commit 0a8721c

Please sign in to comment.