desilerma25 / 10-19-lifecycle-methods

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lifecycle Methods

  • Make a fetch request -> LCM: componentDidMount
  • When an item is added to the cart, remove the Add To Cart button --> LCM: shouldComponentUpdate, componentDidUpdate
  • Toggle between viewing the cart and viewing the items shopping page.
  • Set an interval to show time of shopping, and correctly clear the interval when necessary --> LCM: componentDidMount, componentWillUnmount
  • When the image of an item is clicked, it will show the second image
  • Perform the filter and preserve state correctly

Lifecycle Methods Diagram

How to Run

All of the toy data is stored in the db.json file. You'll want to access this data using a JSON server. In order to do this, run the following two commands:

npm install -g json-server
json-server --watch db.json

This will create a server storing all of our lost toy data with restful routes at http://localhost:3000/items. You can also check out http://localhost:3000/items/:id

About


Languages

Language:JavaScript 76.3%Language:HTML 16.6%Language:CSS 7.2%