0.0.2 • Published 9 years ago
redux-fetch-ts v0.0.2
This package is a TypeScript port of the callAPIMiddleware shown here.
The new action type IFetchAction has the following properties:
typeslists the three actions to be emitted when the fetching begins, succeeds and fails.shouldFetchis a predicate function that determines whether a fetch should happen based on the Redux store.payload: information that will be emitted along with the "begin" and "success" actions.url: the URL to fetch from.
Type variables for IFetchAction:
BeginActionName,SuccessActionNameandFailActionName: literal strings for the names of the respective actionsState: the state of the root Redux store.Result: the result of the fetch.Payload: the payload