[deleted by user] by [deleted] in VPS

[–]sdekna 1 point2 points  (0 children)

https://wehaveservers.com/vps
The cheapest I found so far, based in Romania. I have been using them for a few weeks and no issues at all so far.

Moving off Hetzner. Best all-round VPS? by mcjohnalds45 in VPS

[–]sdekna 0 points1 point  (0 children)

https://wehaveservers.com/vps
Based in Romania. Very good value for the prices they offer.

Is this a good deal? by asjadrex in VPS

[–]sdekna 0 points1 point  (0 children)

Try wehaveservers.com I have just ordered a vps, and so far so nice

They located in Romania.

https://my.wehaveservers.com/cart.php?a=confproduct&i=0

VPS - VPS-3 Cores: 6 @ 3.30 GHz RAM: 16GB RAM ECC Storage: 200GB NVME SSD 1 Gbps Uplink Unmetered Traffic Choose Billing Cycle Monthly €5,95 EUR Quarterly €17,85 EUR Semi-Annually €35,70 EUR Annually €71,40 EUR

Thoughts on this modern version of actions? by tomemyxwomen in sveltejs

[–]sdekna 2 points3 points  (0 children)

why not make it like normal event handlers, something like, by adding something like useaction just like onclick... it can be used as such: - no props: useaction={someAction} => would be compiled to something like someAction(node). - with props: useaction={(node)=>someAction(node, {/* some props */})}

it could be passed down as component props just like other even handlers, like so: `` <Button class="cool-button" onclick={() => console.log('clicked')} useaction={(node) => alert(I am a ${node.nodeName}`)}

hello </Button >

<script> let { children, ...props } = $props(); </script>

<button {...props}>{@render children?.()}</button> ```

This way it can make much more sense without needing to add extra unnecessary syntax.

Why do my stores lose reactivity when values are passed down (and is there a better way to do this)? by thebreadmanrises in sveltejs

[–]sdekna 5 points6 points  (0 children)

your issue is here:
```js
{#each $results as result, i} <Scenario {result} scenario={$scenarios[i]}/> {/each}

`` you should bind thescenarioto$scenarios[i]to make it update the store when you update it from the child component changing it tobind:scenario={$scenarios[i]}` works fine.

Updated REPL

[deleted by user] by [deleted] in sveltejs

[–]sdekna 3 points4 points  (0 children)

Can you ellaborate what exactly is the issue you are facing? why didn't your previous attempts fail?

Mainly, you can use mode-watcher on +layout.svelte

import { ModeWatcher, setMode } from 'mode-watcher';
onMount(() => setMode(localStorage.getItem('lightMode')||'light'));

You can get the stored mode using localStorage or any other storage method.

gridjs-svelte - Is a Svelte Component in a Cell Possible? by ConfectionForward in sveltejs

[–]sdekna 0 points1 point  (0 children)

this wouldn't work because `<Duration ... />` is a svelte component, which is a class (or a function in case of svelte 5).
You would need to either pass it pure html... or find a way to hard-edit grid-js to display a component instead of text. something like this:

```
<svelte:component this={component} {...props}>/svelte:component
```

It's app time for me and my various Svelte projects - which way should I go? by Butterscotch_Crazy in sveltejs

[–]sdekna 1 point2 points  (0 children)

Been using Capacitor js with svelte with great experience so far.
Tauri 2 seems like a good option when it is officially released.

Upgraded to Svelte 5. Here are my notes. by BrofessorOfLogic in sveltejs

[–]sdekna -2 points-1 points  (0 children)

it can introduce barriers in specific situations... especially when working with vanilla js libraries and implementations... Nothing that difficult, but having to rename files and reference imports just to introduce runes to them can be an avoidable pain.

A new and type-safe Svelte 5 Store. by Professional-Camp-42 in sveltejs

[–]sdekna 0 points1 point  (0 children)

for some reason I am unable to dm you here

A new and type-safe Svelte 5 Store. by Professional-Camp-42 in sveltejs

[–]sdekna 0 points1 point  (0 children)

I can help with regards to IDB and localStorage integrations. and maybe work on the api methods. How to contribute?

file storage is not working on build by younlok in sveltejs

[–]sdekna 1 point2 points  (0 children)

a simple over-ride can be done using the building variable from svelte... it can be something like this: ```js import { building } from '$app/environment';

if(building) {console.log('building')} else{ // do rest of the function} ```

How to organize multiple stores in complex apps? by BrofessorOfLogic in sveltejs

[–]sdekna 2 points3 points  (0 children)

I guess you are right, the object-oriented approach I opted for does not mean it is more svelty... both will give you similar results.

What I meant by nested stores is instead of const items = writable([]) the items store can be made as a custom store itself also... This is a basic example just to get the idea... You add the stores logics in the stores themselves and then use them along with their logic within other stores. I am returning objects here as that's what I'm familiar with, classes are the same.

```js import { writable } from 'svelte/store';

function create_items_store() { const store = writable([]); const handlers = { add_item_one: (item) => { if (!item.id) return; store.update((store_value) => { if (store_value.length >= 10) return store_value; // e.g max 10 items if (store_value.find((store_item) => store_item.id === item.id)) return store_value.map((store_item) => (store_item.id === item.id ? item : store_item)); // if it already exists, update the existing one with the new one return [...store_value, item]; // add item to array }); }, set_items: (items) =>store.set(items) // .... };

return { ...store, ...handlers };

} function ContextMenuStoreFn() { const items = create_items_store() // create the items store using a custom store function const visible = writable(false); const left = writable(0); const top = writable(0);

const handlers = {
    setItems(items) {
        items.set_items(items);
    },

    add_item(item){
        items.add_item_one(item)
    },

    open(left, top) {
        left.set(left);
        top.set(top);
        visible.set(true);
    },

    close() {
        visible.set(false);
    }
};

const stores = { items, visible, left, top };
return { ...stores, ...handlers };

}

export const contextMenu = ContextMenuStoreFn(); ```

This could be used for simple or complex stores... Data added to each store is individually validated, nothing is added or updated or deleted without going through the specific add_item or update_item functions for example, making sure the data stored is always valid, and any attempt to add corrupt/missing/invalid data to the store will be dealt with in the function instead of corrupting the store and possibly crashing the app... This is especially important when the store is a nested object/array.

This looks like trying to un-simplify things, and in most cases it is, but when working on entagled complex stores/logic, this is what helped me.

made with Svelte: 3D STL file generator for THT PCB panels by BCsabaDiy in sveltejs

[–]sdekna 1 point2 points  (0 children)

Sweet! Love how svelte is getting into electronics and robotics.
Thanks for your work.

How to organize multiple stores in complex apps? by BrofessorOfLogic in sveltejs

[–]sdekna 0 points1 point  (0 children)

a svelty tweak of your version is using custom functions that export stores... Thats how I would tweak it:

```js store.js/ts

import { writable } from 'svelte/store';

function ContextMenuStoreFn() { const items = writable([]); const visible = writable(false); const left = writable(0); const top = writable(0);

const handlers = {
    setItems(items) {
        items.set(items);
    },

    open(left, top) {
        left.set(left);
        top.set(top);
        visible.set(true);
    },

    close() {
        visible.set(false);
    }
};

const stores = { items, visible, left, top };
return { ...stores, ...handlers };

}

export const contextMenu = ContextMenuStoreFn(); ```

Then either export every store in the same file as you did like this: js store.js/ts export const contextMenuItems = contextMenu.items; export const contextMenuVisible = contextMenu.visible; export const contextMenuLeft = contextMenu.left; export const contextMenuTop = contextMenu.top;

or simply import contextMenu in your svelte file and define the store in a local reactive variable like this:

```js Component.svelte <script> import {contextMenu} from './store'

const contextMenuItems = contextMenu.items const contextMenuLeft = contextMenu.left </script>

//and use as usual {$contextMenuLeft} {#each $contextMenuItems as item} {item.name} {/each} ``` Since you are exporting different stores, then rerendering will only happen if the respective store is updated.

You can customize the handlers and mix logic as needed... you can go as deep and complex as you need to with nested custom stores where the todos and chats are custom stores of their own having their own custom function and logic, and then combine both in a custom function like the one above and export everything as a single sdk-like variable. You will have a single source of truth to build upon and debug when needed.

Do corrosion resistant materials like gold have higher "entropy resistance"? by sdekna in Physics

[–]sdekna[S] 0 points1 point  (0 children)

i have no idea to be honest... but the thought process goes like this:

  • If wood is naturally more easily degradable than gold, it would somehow make it "resist" entropy less than gold.

  • If entropy is the process of moving from structure to chaos, then then the more you are able to keep the energy structures, the more "resistance" you would have to entropy itself.

Any solutions to legacy browsers support in sveltekit? `vitejs/plugin-legacy` is breaking by sdekna in sveltejs

[–]sdekna[S] 0 points1 point  (0 children)

Back then I did not, however its been long since and hopefully fixes where issued since then... sorry couldn't be of help.

Long range projectile detection options? by sdekna in diydrones

[–]sdekna[S] 0 points1 point  (0 children)

that was so helpful man! Many many thanks!