mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
33e65c6fd4
Summary:
Similar to Android Venice impl, I plan to reuse old Timing native module because it's quite complex, and there's not much to gain from re-writing it. When we delete bridge access from it, we can remove any cruft, but IMO it's quite lean already.
The name of this class is a little confusing IMO, I originally had it because it was similar to `Timers.java` but then Emily renamed :p Here's the architecture drawn out:
{F209114665}
If anyone has a better name I'm all ears.
Reviewed By: RSNara
Differential Revision: D17376028
fbshipit-source-id: 066ae0b379cd00538021a1327a4dd63d5a828608
33 lines
937 B
Objective-C
33 lines
937 B
Objective-C
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <React/RCTBridgeModule.h>
|
|
#import <React/RCTFrameUpdate.h>
|
|
#import <React/RCTInvalidating.h>
|
|
|
|
@protocol RCTTimingDelegate
|
|
|
|
- (void)callTimers:(NSArray<NSNumber *> *)timers;
|
|
- (void)immediatelyCallTimer:(nonnull NSNumber *)callbackID;
|
|
- (void)callIdleCallbacks:(nonnull NSNumber *)absoluteFrameStartMS;
|
|
|
|
@end
|
|
|
|
@interface RCTTiming : NSObject <RCTBridgeModule, RCTInvalidating, RCTFrameUpdateObserver>
|
|
|
|
- (instancetype)initWithDelegate:(id<RCTTimingDelegate>) delegate;
|
|
- (void)createTimer:(nonnull NSNumber *)callbackID
|
|
duration:(NSTimeInterval)jsDuration
|
|
jsSchedulingTime:(NSDate *)jsSchedulingTime
|
|
repeats:(BOOL)repeats;
|
|
- (void)deleteTimer:(nonnull NSNumber *)timerID;
|
|
|
|
@end
|
|
|