---
title: Redux
---
### Stores
```js
import { createStore } from 'redux';
function counter(state = 0, action) {
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
return state - 1;
default:
return state;
}
}
```
```js
let store = createStore(counter);
store.subscribe(() => { ... })
store.dispatch({ action })
store.getState()
store.dispatch({ type: 'INCREMENT' }); // 1
store.dispatch({ type: 'DECREMENT' }); // 10
```
### React Redux
```js
React.render(