SwiftPreviewStore

@ObjCName(name = "ReduKtPreviewStore", exact = true)
class SwiftPreviewStore<State : Any>(initialState: State, reducer: <Error class: unknown class><State>) : SwiftStore<State>

previewStore equivalent that implements SwiftStore.

Constructors

Link copied to clipboard
fun <State : Any> SwiftPreviewStore(initialState: State)
Link copied to clipboard
fun <State : Any> SwiftPreviewStore(initialState: State, reducer: <Error class: unknown class><State>)

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
open override 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.