RCTUIManagerObserverCoordinator: new way to subscribe for granular notifications from UI Manager

Reviewed By: majak

Differential Revision: D4868591

fbshipit-source-id: 24a09ffa3e69dec5ce1f0a8715c7e4701d781996
This commit is contained in:
Valentin Shergin
2017-05-08 12:40:07 -07:00
committed by Facebook Github Bot
parent 2a984326b0
commit 712b1dd20a
7 changed files with 183 additions and 56 deletions

View File

@@ -28,7 +28,7 @@ RCT_EXPORT_MODULE();
{
[_nodesManager stopAnimationLoop];
[self.bridge.eventDispatcher removeDispatchObserver:self];
[self.bridge.uiManager removeUIManagerObserver:self];
[self.bridge.uiManager.observerCoordinator removeObserver:self];
}
- (dispatch_queue_t)methodQueue
@@ -48,7 +48,7 @@ RCT_EXPORT_MODULE();
_preOperations = [NSMutableArray new];
[bridge.eventDispatcher addDispatchObserver:self];
[bridge.uiManager addUIManagerObserver:self];
[bridge.uiManager.observerCoordinator addObserver:self];
}
#pragma mark -- API
@@ -196,6 +196,8 @@ RCT_EXPORT_METHOD(removeAnimatedEventFromView:(nonnull NSNumber *)viewTag
[_preOperations addObject:operation];
}
#pragma mark - RCTUIManagerObserver
- (void)uiManagerWillFlushUIBlocks:(RCTUIManager *)uiManager
{
if (_preOperations.count == 0 && _operations.count == 0) {