Main Thread¶
Properties and precondition checkers related to Android, iOS and macOS main thread.
Supported platforms: macOS (x64), iOS (arm32, arm64 & x64), Android, JS.
Content¶
This split provides several properties related to main Thread and 2 precondition checkers.
Here’s the list:
mainLooper: Shortcut toLooper.getMainLooper()!!with caching (Android only).mainThread: Shortcut toLooper.getMainLooper()!!.threadwith caching (Android only).isMainThread: Boolean property that is true if the current Thread is the main Thread (alwaystruein JS).checkMainThread(): Throws anIllegalStateExceptionif not run on the main Thread.checkNotMainThread(): Throws anIllegalStateExceptionif run on the main Thread (always throws in JS).
Download¶
implementation("com.louiscad.splitties:splitties-mainthread:3.0.0-beta01")