Giter Club home page Giter Club logo

pursuit-core-web-redux-lab-two's Introduction

Pursuit-Core-Web-Redux-Lab-Two

App

ReduxToDos

Specification

Build a todo app using Redux. This app does not require a Back-end to persist the data the redux store is enough for now.

A user should be able to:

  1. Create a ToDo
  2. Toggle a ToDo between completed and uncompleted
    • Clicking a non-completed ToDo should mark it as completed. Display the ToDo crossed out when completed.
    • Clicking a completed ToDo should mark the todo as active(not completed). Remove the crossing out.
  3. [BONUS] Filter by active(non-completed), completed, or all ToDos.

Address this in order. Set up your store, reducer an action for creating a todo first and verify it works then move to point 2 and 3.

Todo

A todo object should have the following properties.

{
  id: 1,
  text: "Buy groceries",
  completed: true // or false
}

State

Your state to store this information would look like:

{
  nextTodoId: 1,
  todos: [],
  visibilityFilter: "all" // One of "all", "completed" or "active"
}
  • nexTodoId is just a counter you will use to assign a simple id to your todos. Each time a new todo is added use the current value of nextTodoId to give your todo that id and increment nextTodoId there after for next time.
  • todos keeps todo objects.
  • When the user click's the button Completed you will set the visibilityFilter and filter todos for only todos that are completed and display those completed todos.
  • When the user click's the button Active you will filter todos for only todos that are not completed and display those non-completed todos to the user.

Actions

Here are some suggestions for your actions and action types. You can, of course, come up with your own:

  • ADD_TODO
{
  type: 'ADD_TODO',
  payload: {
    text: 'Do something.'  
  }
}
  • TOGGLE_TODO
  • SET_VISIBILITY_FILTER

Resources

These literally solve the lab.

pursuit-core-web-redux-lab-two's People

Contributors

alejo4373 avatar benstone1 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.