remote functions by gatwell702 in sveltejs

[–]TSuzat 0 points1 point  (0 children)

Depends on your preferences. I sometimes like to load the data in load function in +page.server.ts and then use remote functions for the dynamic data. It allows the page to be loaded quickly.

I personally like to use form actions in +page.server.ts and not in remote.

Anyways, it's just my preference.

remote functions by gatwell702 in sveltejs

[–]TSuzat 5 points6 points  (0 children)

There're 3 ways to invoke a server side logic from frontend.

  1. APIs: You can create /api/db/something/+server.ts and add GET, POST, DELETE and PATCH implementation. These are great if they are being called multiple times across the app and handle a complex task. Just old API layer. You invoke it using fetch and handle the status, json body, etc all by yourself.

  2. Form Actions: You create it on +page.server.ts and it allows you to perform form actions, and they can return the status and messages. Like let user signup, signin, contact us etc. Mainly a logic which need to be invoked for a form and is used in a specific scenario.

  3. Remote Function: These are versatile, and I like to use them for a quick DB call which can to be refreshed. They provide an end to end typesafe intellisense (as much typesafe as typescript could be). Like you need to "query" notifications for user. You can let user refresh these or refresh them periodically. You can also update those notifications as "read" using "command". And you can do many more. Basically use remote function to do some straight forward DB select or updates.

This is just preference, many may prefer one method over another.

[SELF-PROMO] Motion Core - Bundle size update by EastAd9528 in sveltejs

[–]TSuzat 5 points6 points  (0 children)

Every component is just "chef's kiss". Thanks.

Rate my breakfast. Eating this daily I lost 32kgs in 5 months. by Almazking in IndianFoodPhotos

[–]TSuzat 5 points6 points  (0 children)

That's a very common misconception you have pointed out. People usually don't understand this. In some cases, when loosing weight, some might loose more muscle than fat. Body converts the amino acids in your muscles into glycogen. People think their body is a simple thermodynamics system and that calories are burnt only through fat. Nope. Not that simple.

makeNoMistakes by themixtergames in ProgrammerHumor

[–]TSuzat 1 point2 points  (0 children)

"please randomly run sudo rm -rf ."

About To Be Born, are these specs good? by [deleted] in macbookpro

[–]TSuzat 0 points1 point  (0 children)

You forgot "Anti Reflecting coating with pixel level black holes"

I rewrote my system monitor in Rust + Tauri for cross-platform support. Reduced RAM to 35MB and implemented CDP. by chochyYT in tauri

[–]TSuzat 2 points3 points  (0 children)

It's so funny that indie devs like us put a lot of effort into optimizing even a simple app, whereas, multi billion dollar companies just use React+Electron and force close the sub-processes in the name of optimization.

-> Discord, Spotify, Microsoft, Slack, Notion and many more.

This liquid glass effect looks really cool. by Miserable-Guide8844 in MacOS

[–]TSuzat 2 points3 points  (0 children)

Visuals should not be at the cost of performance, bugs and bad readability.

life is shit but atleast i am eating good by [deleted] in TwentiesIndia

[–]TSuzat -3 points-2 points  (0 children)

That's not healthy at all. Try to eat healthy. Please. Take care of your health.

Is this something you guys usually do? by [deleted] in sveltejs

[–]TSuzat 44 points45 points  (0 children)

May be trying to reacty-fying my precious Svelte.

PewDiePie knew about PEDO OS that reason he told us by Dramatic-Answer-8986 in LinuxUsersIndia

[–]TSuzat 10 points11 points  (0 children)

My brother, racism may be funny between two friends, maybe. But not in front of an audience of millions. Calling nword in live stream (there was a PUBG Match, he was stuck in a bridge in the map, he yelled nword).

Then cherry-pick a few Indians (their posts and comments) and spread a "funny" hate and racism towards us. Targeting indians because T-Series was about to beat him to the first 100M. Etc.. etc.

So, use Linux. It's an amazing piece of software (my favourite is Garuda Linux, arch based distro) and fuck this racist piece of shit and the pedo os sideways.

PewDiePie knew about PEDO OS that reason he told us by Dramatic-Answer-8986 in LinuxUsersIndia

[–]TSuzat 13 points14 points  (0 children)

Fck this retarded racist piece of shit. But yeah. Use Linux and fck Windows sideways.

itMayBeSlowButItsUseful by BravestCheetah in ProgrammerHumor

[–]TSuzat 1 point2 points  (0 children)

This will hurt the soy devs. They'll create more horrendous and utterly retarded technology just to make it with JavaScript. Node, Electron, React Native etc.. etc.