ahoym / redesert

Work in Progress - Opinionated HOFs for auto-generating REST API consuming redux logic
MIT License
3 stars 1 forks source link

Api redux-thunk factory #13

Closed ahoym closed 6 years ago

ahoym commented 6 years ago

Context

Adds a light wrapper higher order function that will dispatch all actions of an API life cycle, that are immediately recognized by reducers created through resourceReducerFactory.

In general, all API requests follow the general pattern of:

  1. start the request
  2. API responds, handle the success or
  3. API responds, handle the error

As noted in the redux docs: https://redux.js.org/advanced/async-actions

Additional Changes

Tasks

codeclimate[bot] commented 6 years ago

Code Climate has analyzed commit 615645c8 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 97.7% (0.2% change).

View more on Code Climate.

ahoym commented 6 years ago

Codeclimates are irrelevant on code duplication. One block was using a .then, the other was using .catch