chingu-voyage4 / Bears-Team-15

Flashcards application

Home Page:https://cards-bears-15.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refactor: Move IDs inside collection

AntonTymczenko opened this issue · comments

*bug: * When User at collectionNew leaves the page, should not save to localStorage.

*solution: *

  • Make all collections have IDs inside of itself.
  • Put some counter in state, increment it on every added collection to collections array
  • CollectionNew component in its created lifecycle hook should create a collection with id=temporary in state . If it is already there – overwrite it with blank collection
  • CollectionNew shoud save id=temporary collection to collections with some other, numbered, ID. It should save on @save event received from child CollectionEdit