N
N
Nikita Andreevich2020-05-24 13:26:11
JavaScript
Nikita Andreevich, 2020-05-24 13:26:11

How to clear data from AsyncStorage/localStorage every day?

I am writing an app in react native. During the day, the user enters certain data, and this data is stored in the local storage. Certain statistics are maintained. How to delete all data from local storage at 00:00?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2020-05-24
@NikitosAndreevich

to add a timestamp to the data, to each record.
When activated and on a timer, take out the trash.
Include only lines with today's time in the calculation of statistics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question