Closed 0FilipK closed 6 years ago
Hello, I'm trying to make an API call with params but I achieved only empty API call for now. Here is code:
You defined request type as empty using void type.
You need to change the request type to include params if you want to pass it to the request as you done in the second approach.
Reading from your code the request type should be:
type Request = {
type: string,
}
Closing because such questions belong to Stack Overflow.
Hello, I'm trying to make an API call with params but I achieved only empty API call for now. Here is code:
Actions:
Call dispatch:
store.dispatch(fetchCats.request());
My epics:
API:
I tried to call dispatch like this:
store.dispatch(fetchCats.request(data));
but request expects 0 params. And like this:store.dispatch({ type: fetchCats.request(), data});
Probably I should do something like this:
but I don't know how to transform this actions properly. In docs: https://github.com/piotrwitek/typesafe-actions#--the-async-flow there is no such an example with passing params.