mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
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:
committed by
Facebook Github Bot
parent
2a984326b0
commit
712b1dd20a
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user