Thunk withExtraArgument
rezanouri87 opened this issue · 1 comments
rezanouri87 commented
Hey Guys,
Thanks for this useful tool. I was wondering if there is any way to pass extra arguments to thunk? Similar to:
const store = createStore( reducer, applyMiddleware(thunk.withExtraArgument(api)) )
Thanks
MillerGregor commented
It is supported, but not released on npmjs. #9 added it way back.
I chose a recent fork for my devDep.
Use it like this:
const extraArgument = { sdk: SDK };
const dispatches = await Thunk(
clientDuck.fetchAll,
extraArgument
).execute();
each(dispatches, spatch => {
console.log(spatch.getAction());
});