Skip to content

Commit

Permalink
Setting Up Redux STORE, REDUCER & ACTIONs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch-sriram committed Aug 24, 2020
1 parent e9d2284 commit 49e1e3a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,8 @@ Firebase Common API Endpoint: <https://burger-builder-ram.firebaseio.com/>
11. Handling Overall Form Validity: [Commit Details](https://github.com/Ch-sriram/burger-builder/commit/a319cb9fda29ac9fb3ef21fe8b656d1c55a3b301)
12. Fixing an Error Related to Drop Down Component's State in `<ContactData />`: [Commit Details](https://github.com/Ch-sriram/burger-builder/commit/02c8afe907d185ff72c395de581e5cba259b45fe)
13. Fixing a Minor Bug: [Commit Details](https://github.com/Ch-sriram/burger-builder/commit/881f39f67deca14650953d01767aabcb8c93b8dc)

### Adding Redux ♻ To Our Project 🍔🛠

**Dependency Installation: `npm i --save redux react-redux`**
1. Setting Up Redux **`STORE`**, **`REDUCER`** & **`ACTIONs`**: [Commit Details]()
2 changes: 2 additions & 0 deletions src/store/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const ADD_INGREDIENT = "ADD_INGREDIENT";
export const REMOVE_INGREDIENT = "REMOVE_INGREDIENT";
12 changes: 12 additions & 0 deletions src/store/reducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as actionTypes from "./actions";

const initialState = {
ingredients: null,
totalPrice: 4,
};

const reducer = (state = initialState, action) => {
return state;
}

export default reducer;

0 comments on commit 49e1e3a

Please sign in to comment.