Closed Proladon closed 2 years ago
Not sure if it's the best way, but it worked well enough:
The renderer shouldn't know anything about lowdb. The renderer should be passing JSON payloads over ipc to the main process, and then the main process saves that data using the lowdb instance.
One of my projects using this: https://github.com/ste163/vislit-prototype/blob/main/src/main/background.js
Not sure if it's the best way, but it worked well enough:
The renderer shouldn't know anything about lowdb. The renderer should be passing JSON payloads over ipc to the main process, and then the main process saves that data using the lowdb instance.
One of my projects using this: https://github.com/ste163/vislit-prototype/blob/main/src/main/background.js
nc job 👍 actually I just don't know how to keep lowdb instance in main process, that I can reuse it lol I'v already understood after read ur source code, thx
but I still wanna to know is there have others way, so I'm gonna keep this issues opening
Going to close as there's not much activity and it's more a question than an issue. Thanks for sharing @ste163
Communicate with ipcMain and ipcRenderer will lost the Low instance turn into normal object :
so I'v to re new a Low instance in everytimes like :
Is there have a better ways?