Function: useMainThreadObject()
useMainThreadObject<
I,Oextendsobject>(objectType:MainThreadObjectType<I,O>,initialValue:I):O
Create a stable handle that resolves to an object of the supplied type in main-thread functions.
This primitive is intended for library hooks. The returned target type is only callable in a main-thread function; it must not be used from the background runtime.
Type Parameters
Parameters
Returns
O
The main-thread-only target type.