Giter Site home page Giter Site logo

redux-nested-state-challenge's Introduction

Redux Challenge

starter code

First Task

Your first task is to implement a note taking app using Redux. You should be able to add notes and delete notes by clicking on their text.

The React components are already built out for you and they are even connected up to the Redux Store. On the appropriate click events, action creator functions defined in src/actions/index.js are called. Currently they will error out since actions need a type property. (Action creators are just functions which return actions. Actions are plain JS objects with a type key).

You should only need to change code in two files:

  • src/actions/index.js
  • src/reducer.js

Notes

Make sure your reducer function does not destructively modify state.

Note that we can mimic notes having unique ids when they are created by using Date.now()

Second Task

So your note taking app works as is, but you would like to organize your notes by subject...

challenge

This will make the shape of your Redux state significantly different. Begin by replacing the initialState variable in your reducer with this new object:

const initialState = {
  activeSubjectId: 1,
  subjects: [
    {
      id: 1,
      title: 'React',
      notes: []
    },
    {
      id: 2,
      title: 'Redux',
      notes: []
    },
    {
      id: 3,
      title: 'Functional Programming',
      notes: []
    },
    {
      id: 4,
      title: 'Ruby',
      notes: []
    }
  ]
};

Comment-in the <SubjectTabs /> Component in <App />. You'll have to make some changes to your current NoteView implementation since the state from Redux has changed.

Your task is to implement this new functionality. There are many ways to get this to work and feel free to re-think any of your initial starting code. This is pretty challenging, work methodically.

redux-nested-state-challenge's People

Contributors

alexgriff avatar slin12 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.