Day 40 of 100 Days Of Code

Image from XKCD

Day 40: September, Sunday

Today ‘s Progress: I continued work on Redux Introduction to the Redux Challenges.

Thoughts: Redux and react are pretty crappy!

Resources used:

const ADD = 'ADD';
const reducer = (state = 0, action) => {
  switch(action.type) {
    case ADD:
      return state + 1;
    default:
      return state;
  }
};
const store = Redux.createStore(reducer);
// global count variable:
let count = 0;
// change code below this line
const incrementCounter = () => count +=1
store.subscribe(incrementCounter);
// change code above this line
store.dispatch({type: ADD});
console.log(count);
store.dispatch({type: ADD});
console.log(count);
store.dispatch({type: ADD});
console.log(count);

This was a pretty hard challenge, instructions were not very clear at all and there were no examples.

Link(s) to work

  1. Continued work on Introduction to the Redux Challenges (trying to) learn Redux.

Introduction to the React Challenges

  • PassedDispatch an Action Event
  • PassedHandle an Action in the Store
  • PassedUse a Switch Statement to Handle Multiple Actions
  • PassedUse const for Action Types

All code is in GitHub FCC-Introduction to the redux Challenge.

Written on September 2, 2018