Skip to content

Latest commit

 

History

History
208 lines (172 loc) · 3.92 KB

README.md

File metadata and controls

208 lines (172 loc) · 3.92 KB

actions

getFavorites

parameters -
returnType UserData[]
operation Gets all items from local-storage with key user-data and removes items that are not favorite. Then it returns those items.




getUserData

parameters cityName: string
returnType UserData
operation Gets all items from local-storage with key user-data and finds the item with cityName from those items. If found, returns that item otherwise returns undefined.




saveUserData

parameters data: UserData
returnType void
operation Gets all items from local-storage with key user-data and finds the item with data.cityName from those items. If found, modifies that item otherwise adds new item to the items array. If the item is not favorite and there are no notes, then that item is remoived and Then saves the list back to local-storage.




getRemovedCities

parameters -
returnType string[]
operation Gets all items from local-storage with key removed-cities and returns it.




removeCity

parameters name: string
returnType void
operation Gets all items from local-storage with key restored-cities and removes item from the array, then save array to local storage.
Gets all items from local-storage with key removed-cities and checks for item existance. If not found, then adds it to the array, save array to local storage.




getRestoredCities

parameters -
returnType string[]
operation Gets all items from local-storage with key restored-cities and returns it.




restoreCity

parameters name: string
returnType void
operation Gets all items from local-storage with key removed-cities and removes item from the array, then save array to local storage.
Gets all items from local-storage with key restored-cities and checks for item existance. If not found, then adds it to the array, save array to local storage.




getExcludedCities

parameters -
returnType string[]
operation Gets all items from local-storage with key excluded-cities and returns it.




updateExcludedCities

parameters -
returnType string[]
operation Gets all items from local-storage with key removed-cities and dumps it to excluded-cities in local-storage.