Giter Site home page Giter Site logo

redux-dispatch-practice-v-000's Introduction

Pet Dispatcher Lab

so many pets

Objectives

  1. Write a reducer that can return a default state
  2. Construct a dispatch function that is invoked with an action, stores the updated state, and renders the new state to the DOM
  3. Write a render function that uses vanilla JS to display pet information from the state on a web page

Overview

Ever have that feeling where you are just surrounded by so many of your pets that you start to lose track of all of them. Well now there's an app for that-- or there will be-- you're going to build it! By dispatching actions such as "ADD_PET" and "REMOVE_PET" to your reducer, you will track your current pets and display them in a beautiful <ul> in the browser.

Instructions

In managePets.js you need to write three functions managePets, dispatch, and render.

  1. The managePets reducer function needs to have a sensible default state
  2. dispatch should pass an action to the reducer and use that return value to update the state, a globally accessible variable
  3. Since our users want to see their pets on a webpage we want to have a render method that inserts a <ul> to the DOM with each pet's name wrapped in an <li>. The <ul> should be a child of an element with the id of container. There's no need to load jQuery into our app for such a small task. We can make use of built-in JavaScript methods like document.getElementById.

redux-dispatch-practice-v-000's People

Contributors

jeffkatzy avatar lukeghenco avatar storywr avatar

Watchers

James Cloos avatar  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.