Why is data lost at electron?
Open
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
After react runs the restart program in electron, the cached data in electron is lost, and the web page is not lost。
```
const db = new PouchDB("testdb");
const onCeateDB = () => {
const todo = {
_id: new Date().toISOString(),
title: `这是一条数据${Date.now()}`,
completed: false,
};
db.put(todo, function callback(err, result) {
if (!err) {
console.log("Successfully posted a todo!", result);
}
});
};
const onGetData = () => {
db.allDocs({ include_docs: true, descending: true }, function (err, doc) {
console.log(doc.rows);
});
};
创建数据库
获取数据库
```
Contributor guide
Assessment
This issue has not been assessed yet.