How do i pass an extra argument when dispatching a...
# redux
b
How do i pass an extra argument when dispatching a thunk?
p
There is an
extraArgument
that is passed into the
createThunkMiddleware()
. This argument is then passed to every invocation of a thunk as the
extraArgument
parameter. Is this what you are referring to? If you need to pass an argument a specific thunk you can make a function that creates a thunk with a param: ``` fun myThunk(myArg: String) = createThunk<AppState> { //do thunk code here } There is a sample here: https://github.com/reduxkotlin/ReadingListSampleApp/blob/master/common/src/commonMain/kotlin/org/reduxkotlin/readinglist/common/NetworkThunks.kt