Files
react/fixtures/nesting/src/store.js
Dan Abramov 336729856a Nesting Fixture (#19531)
* Nesting Fixture

* Add README to nesting fixture

* Apply suggestions from code review

Co-authored-by: Ricky <rickhanlonii@gmail.com>

* Fixes

* Add Redux

* Use different versions

* Use Consumer API

* Rename helper

* Write docs

* Update README.md

* Update README.md

Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com>
2020-08-07 02:08:41 +01:00

15 lines
372 B
JavaScript

import {createStore} from 'redux';
function reducer(state = 0, action) {
switch (action.type) {
case 'increment':
return state + 1;
default:
return state;
}
}
// Because this file is declared above both Modern and Legacy folders,
// we can import this from either folder without duplicating the object.
export const store = createStore(reducer);