TimingModule

class TimingModule(reactContext: ReactApplicationContext, devSupportManager: DevSupportManager) : NativeTimingSpec, JavaScriptTimerExecutor

Native module for JS timer execution. Timers fire on frame boundaries.

Constructors

Link copied to clipboard
constructor(reactContext: ReactApplicationContext, devSupportManager: DevSupportManager)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun callIdleCallbacks(frameTime: Double)

Invoke the JS callback registered with requestIdleCallback.

Link copied to clipboard
open override fun callTimers(timerIDs: WritableArray)

Calls the JS callback(s) associated with the timer ID(s). Also unregisters the callback if the timer isn't recurring (e.g. unregisters for setTimeout, doesn't for setInterval).

Link copied to clipboard
open override fun canOverrideExistingModule(): Boolean

Return true if you intend to override some other native module that was registered e.g. as part of a different package (such as the core one). Trying to override without returning true from this method is considered an error and will throw an exception during initialization. By default all modules return false.

Link copied to clipboard
open override fun createTimer(callbackIDDouble: Double, durationDouble: Double, jsSchedulingTime: Double, repeat: Boolean)
Link copied to clipboard
open override fun deleteTimer(timerIdDouble: Double)
Link copied to clipboard
open override fun emitTimeDriftWarning(warningMessage: String)

Shows a warning message in development when environment times are out of sync.

Link copied to clipboard
Link copied to clipboard
open override fun getName(): String
Link copied to clipboard
Link copied to clipboard
open override fun initialize()

This method is called after ReactApplicationContext has been created.

Link copied to clipboard
open override fun invalidate()

The CatalystInstance is going away with Venice. Therefore, the TurboModule infra introduces the invalidate() method to allow NativeModules to clean up after themselves.

Link copied to clipboard

Allow NativeModule to clean up. Called before {CatalystInstance#onHostDestroy}

Link copied to clipboard
open override fun setSendIdleEvents(sendIdleEvents: Boolean)