Webapp settings

Would you have settings in a json object in a single store or a separate store writable for each setting?
44 Replies
b1mind
b1mindā€¢14mo ago
what kinda of settings? Probably just one writeable #depends xD
MartynasXS
MartynasXSā€¢14mo ago
well I have some for conditional logic for first render of the ui
b1mind
b1mindā€¢14mo ago
Would probably depend how I'm saving the settings too šŸ˜„
MartynasXS
MartynasXSā€¢14mo ago
{
"PreferredMode": "linear",
"IgnoreBW": true,
"RitoBinPath": "C:\\custom skins\\ritobin\\ritobin_cli.exe",
"RememberTargets": false,
"Targets": [
false,
false,
false,
false,
true
],
"Regenerate": true
}
{
"PreferredMode": "linear",
"IgnoreBW": true,
"RitoBinPath": "C:\\custom skins\\ritobin\\ritobin_cli.exe",
"RememberTargets": false,
"Targets": [
false,
false,
false,
false,
true
],
"Regenerate": true
}
b1mind
b1mindā€¢14mo ago
yea should be ok with one writeable
Jochem
Jochemā€¢14mo ago
massive massive alarmbells at a .exe in frontend code please tell me that's only used to generate a command the user can then copy paste?
b1mind
b1mindā€¢14mo ago
I think its a Tauri app
MartynasXS
MartynasXSā€¢14mo ago
its a tauri app indeed i use the .exe for conversion actions as im not into writing binary magic in js its not my exe also
Jochem
Jochemā€¢14mo ago
ah, right, forgot that you were working on that
MartynasXS
MartynasXSā€¢14mo ago
I would prefer to handle it on my own, but its a project for another day so followup question, so would you subscribe to whole object in route level and pass specific parts of it as a prop to components or subscribe to the store in each component individually
b1mind
b1mindā€¢14mo ago
I would use $ and in comps Whole point of the global context is not to prop drill (least one point) Pretty much always use the auto-sub syntax xD https://learn.svelte.dev/tutorial/auto-subscriptions (click solve) just so clean šŸ„° oh they do use the methods in those xD I just $store = value or $store.thing = value
MartynasXS
MartynasXSā€¢14mo ago
hmmm
ErickO
ErickOā€¢14mo ago
Booleans for settings bad
b1mind
b1mindā€¢14mo ago
shush
ErickO
ErickOā€¢14mo ago
Baaad
Want results from more Discord servers?
Add your server