> For the complete documentation index, see [llms.txt](https://mgcrea.gitbook.io/redux-rest-resource/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mgcrea.gitbook.io/redux-rest-resource/basics/reducers.md).

# Reducers

**Reducers** are pure functions that takes the previous state and an action, and returns the next state.

```javascript
(previousState, action) => newState;
```

## Exported store state

**Redux REST Resource** will manage the state for you and store related data inside it. You have state-related booleans (like `isFetching`) that enables smooth UI feedback.

```javascript
import {initialState} from 'redux-rest-resource';

initialState ==
  {
    // FETCH props
    items: [],
    isFetching: false,
    lastUpdated: 0,
    didInvalidate: true,
    // GET props
    item: null,
    isFetchingItem: false,
    lastUpdatedItem: 0,
    didInvalidateItem: true,
    // CREATE props
    isCreating: false,
    // UPDATE props
    isUpdating: false,
    isUpdatingMany: false,
    // DELETE props
    isDeleting: false,
    isDeletingMany: false
  };
```
