Your video's are helping alot comprehending this maze of Electron and Svelte. I can't thank you enough! I needed to store a integer value and was running into a bug when one of the values was zero where the getwindowsettings function would turn back to the default value. Turns out 'if (!x) return x' also returns false when the value is an integer with a value of 0. Rewriting it to 'if (!x == undefined)' fixed it as all get requests which are not in the store return undefined. Really enjoying your content!
Well you would like any other NodeJS app. The main file can call into other files. I don’t really see your problem? If you are confused feel free to message me on Discord
Do you know how to clear data that we set by using electron-store when user uninstall app? I save access-token by using electron-store but I want if user reinstall application it will not auto-login. I have found a method deleteOnUninstall but maybe this is only work on windows
Excellent overview of the basics. How about storing from the Svelte frontend say to NeDB or other data store? Possible using IPC with context bridge? Thanks for these excellent Electron videos!
Good suggestion, Would you rather have more project based focused videos or videos where I show a certain workflow with electron and svelte Like for example a todo app with svelte and nedb?
@@tylerlaceby I was thinking of how to perform CRUD operations. No need for a real tutorial, but an overview would be great! With Svelte would we need a kind of ‘middleware’? Svelte-kit has some kind of endpoints. Is something similar needed with Electron? As if fetching from a server? Hope this makes sense. 😃
@@bjbk6373 No those are good questions also. With svelte we would be creating some sort of api using the preloadScript. For example a window.api.postMessage("message:, data) would be like a post request or the C in crud. There are much more ways of doing this however I think that's probably the best method for crud. I like to think of the backend / main process as the server and the renderer as the client. The client can communicate to the server and the server can response. Its like we sockets since the server/ backend process can also send messages to the client with bi-directional channels. xD
i have some trouble when i type const store = require('electron-store') it says Error [ERR_REQUIRE_ESM]: require() of ES Module not supported. what can i doooooooo?
I cannot help as there could be a couple issues. First make sure you are using this inside a CommonJS module. Make sure the package json is not type: “module”. If it is then don’t use require and instead use the ES6 Imports.
I have recently faced a problem of storing user data (like password) in a data storage. I know it is not the best practice, but the application has to be functioning like this to add auto-login option. Do you know of any ways how to store this kind of sensitive information and encrypt it? Thanks for the response!
Actually yes. One approach is to store them encrypted on the machine using either a cryptography library or using electrons built in one. www.electronjs.org/docs/latest/api/safe-storage Hope this helps
I mean if you have experience with Ipc then the connection should be easily made. If you are still a bit rusty or new to electron then I have a few videos covering IPC communication. This is how to send a message from the renderer to main process. From there you could then use this method of storage. Hopefully this helps
@@tylerlaceby Indexeddb API is weird but using Lovefield or Dexie makes it much much better. its better to leave the main process of electron for orchestration only.
Great video but your typing was very distracting. You made mistakes on every other word it seemed. Slow down your typing and focus on correctness please.
Your video's are helping alot comprehending this maze of Electron and Svelte. I can't thank you enough! I needed to store a integer value and was running into a bug when one of the values was zero where the getwindowsettings function would turn back to the default value. Turns out 'if (!x) return x' also returns false when the value is an integer with a value of 0. Rewriting it to 'if (!x == undefined)' fixed it as all get requests which are not in the store return undefined. Really enjoying your content!
Haha yea love JavaScript comparison statements. Glad you enjoy
i love these, you're awesome.
Thanks xD
how do i use electron-store outside of the main process file?
Well you would like any other NodeJS app. The main file can call into other files. I don’t really see your problem?
If you are confused feel free to message me on Discord
Do you know how to clear data that we set by using electron-store when user uninstall app? I save access-token by using electron-store but I want if user reinstall application it will not auto-login. I have found a method deleteOnUninstall but maybe this is only work on windows
Excellent overview of the basics. How about storing from the Svelte frontend say to NeDB or other data store? Possible using IPC with context bridge? Thanks for these excellent Electron videos!
Good suggestion, Would you rather have more project based focused videos or videos where I show a certain workflow with electron and svelte Like for example a todo app with svelte and nedb?
@@tylerlaceby I was thinking of how to perform CRUD operations. No need for a real tutorial, but an overview would be great! With Svelte would we need a kind of ‘middleware’? Svelte-kit has some kind of endpoints. Is something similar needed with Electron? As if fetching from a server? Hope this makes sense. 😃
@@bjbk6373 No those are good questions also. With svelte we would be creating some sort of api using the preloadScript. For example a window.api.postMessage("message:, data) would be like a post request or the C in crud. There are much more ways of doing this however I think that's probably the best method for crud. I like to think of the backend / main process as the server and the renderer as the client. The client can communicate to the server and the server can response. Its like we sockets since the server/ backend process can also send messages to the client with bi-directional channels. xD
Thank you quick and easy
i have some trouble when i type const store = require('electron-store') it says Error [ERR_REQUIRE_ESM]: require() of ES Module not supported. what can i doooooooo?
I cannot help as there could be a couple issues.
First make sure you are using this inside a CommonJS module. Make sure the package json is not type: “module”. If it is then don’t use require and instead use the ES6 Imports.
is there a way to get store info from front?
Yes. Use IPC. IPC is meant to pass dada and message around between processes.
I have recently faced a problem of storing user data (like password) in a data storage. I know it is not the best practice, but the application has to be functioning like this to add auto-login option. Do you know of any ways how to store this kind of sensitive information and encrypt it? Thanks for the response!
Actually yes. One approach is to store them encrypted on the machine using either a cryptography library or using electrons built in one.
www.electronjs.org/docs/latest/api/safe-storage
Hope this helps
@@tylerlaceby It did help, thank you very much!
Would have been useful for you to show how to use it from the renderer process as well
I mean if you have experience with Ipc then the connection should be easily made. If you are still a bit rusty or new to electron then I have a few videos covering IPC communication. This is how to send a message from the renderer to main process. From there you could then use this method of storage.
Hopefully this helps
Thank you !
indexeddb is fine with electron no need for other databases.
It is but it’s also a pain and choice is always good.
There’s no issues using something other than indexedb. Thanks for your opinion though
@@tylerlaceby Indexeddb API is weird but using Lovefield or Dexie makes it much much better. its better to leave the main process of electron for orchestration only.
I totally agree with that.
Great video but your typing was very distracting. You made mistakes on every other word it seemed. Slow down your typing and focus on correctness please.
Yes it's pretty bad lol.