interface Thunk<State>
Interface that can be dispatched and handled by ThunkMiddleware. Asynchronous operations and Actions may be dispatched from within a Thunk. Due to limitation of K/N a type alias does not work currently. |
typealias ThunkMiddleware<State> = <ERROR CLASS><State> |
fun <State> createThunk(thunkLambda: (<ERROR CLASS>, <ERROR CLASS><State>, extraArgument: Any?) -> Any): Thunk<State>
Convenience function for creating thunks. Usage: val myThunk = createThunk { dispatch, getState, extraArgument -> //do async stuff dispatch(NewAction()) } |
|
fun <State> createThunkMiddleware(extraArgument: Any? = null): <ERROR CLASS><State>
Thunk middleware for async action dispatches. Usage: val store = createStore(myReducer, initialState, applyMiddleware(thunk, myMiddleware)) |
|
fun <State> <ERROR CLASS><State>.withExtraArgument(arg: Any?): <ERROR CLASS> |