erikras / erikras/react-redux-universal-hot-example

How can I process API response before it goes to the reducer?

Open
#1,021 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

How can I process results from an API call before they go to the reducer?

Below is a standard example of a "create" action in a redux module. This boilerplate defines client.post() to only take a param for URL, and another for data. Where would code go to process the response?

```
export function create() {
return {
types: [CREATE, CREATE_SUCCESS, CREATE_FAIL],
promise: (client) => {
return client.post('/charts.json', {
data: {
chart: {
title: null
}
});
}
};
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the create action shown in the issue and trace the CREATE, CREATE_SUCCESS, and CREATE_FAIL lifecycle through the reducer. The issue does not name a file, test, or specific transformation, so the desired response processing and completion criteria need clarification before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.