mirror of
https://github.com/facebook/react.git
synced 2026-02-25 05:03:03 +00:00
* 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>
15 lines
372 B
JavaScript
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);
|