SwiftStore

@ObjCName(name = "ReduKtStore", exact = true)
abstract class SwiftStore<State : Any>

Simplified Store API to provide better interop with Objective-C/Swift.

Constructors

Link copied to clipboard

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun dispatch(action: <Error class: unknown class>)
Link copied to clipboard
open fun dispatchJob(action: <Error class: unknown class>): Disposable

Calls Store.dispatchJob and returns a Disposable that cancels foreground coroutine on dispose call.

Link copied to clipboard
open fun subscribe(onStateChange: (State) -> Unit): Disposable

Invokes onStateChange on each change of currentState. Returns a Disposable that should be disposed when subscription is no longer needed. Initial value is delivered with onStateChange before this method returns.

open fun <Selected> subscribe(selector: <Error class: unknown class><State, Selected>, onStateChange: (Selected) -> Unit): Disposable

Invokes onStateChange on each change of selected state with selector. Returns a Disposable that should be disposed when subscription is no longer needed. Initial value is delivered with onStateChange before this method returns.

Properties

Link copied to clipboard
Link copied to clipboard
abstract val store: <Error class: unknown class><State>

Returns internal store instance that is hidden form Objective-C. It enables implementing any missing delegation to real store as an extension to this class.

Inheritors

Link copied to clipboard