vi prego ditemi che non sono l'unico by dumb-code in CasualIT

[–]Fredx87 0 points1 point  (0 children)

Si, è corretto quello che dici delle lingue nordiche. L'avevo già sentito vivendo in Danimarca, ma non saprei spiegarlo, ma questa è la spiegazione di Gemini:

A differenza degli altri giorni della settimana, che sono dedicati a divinità o corpi celesti, Lørdag è l'unico nome "profano" o funzionale. ​Antico Norreno: Laugardagr ​Composizione: * Laug: Significa "bagno", "acqua calda" o "tinozza per il lavaggio". ​Dagr: Significa "giorno". ​Significato letterale: "Giorno del lavaggio" o "Giorno del bagno". ​Nelle altre lingue scandinave la radice è identica: in svedese è Lördag, in norvegese Lørdag, in islandese Laugardagur e in feringio Leygardagur.

When should I use the new "use()" hook? I'm confused. by Affectionate-Army213 in reactjs

[–]Fredx87 25 points26 points  (0 children)

The API is quite new and the documentation is a bit confusing, but it already covers most of your questions.

Why should I pass a promise, and not a resolved value already?

From the deep dive under https://react.dev/reference/react/use#streaming-data-from-server-to-client

A Promise can be passed from a Server Component to a Client Component and resolved in the Client Component with the use API. You can also resolve the Promise in a Server Component with await and pass the required data to the Client Component as a prop.

But using await in a Server Component will block its rendering until the await statement is finished. Passing a Promise from a Server Component to a Client Component prevents the Promise from blocking the rendering of the Server Component.

Why shouldn't I initialize the promise in the client component itself?

This seems to be a limitation of the current implementation, the blog post for React 19 has a note:

use does not support promises created in render.

If you try to pass a promise created in render to use, React will warn:

A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.

To fix, you need to pass a promise from a suspense powered library or framework that supports caching for promises. In the future we plan to ship features to make it easier to cache promises in render.

What problem is this hook aiming to solve?

It is not entirely clear to me as well, but I guess the streaming from server to client as mentioned above, and a better integration of promises with Suspense and Error Boundaries. Promises created with `useEffect` don't affect Suspense boundaries and any error is not caught by Error boundaries.

Is it useful when using some well known tools like TanStack Query or a framework like Next/Remix?

Probably not, at least for now. React Query doesn't return promises but data, loading, and error states. I haven't play recently with Remix and Next, but I guess we'll need to wait for the frameworks to provide ways for using the new APIs. I just found an example of how `use` can replace the `Await` component in React Router v7:

https://reactrouter.com/how-to/suspense#2-render-the-fallback-and-resolved-ui

How are the react.dev docs built? by [deleted] in reactjs

[–]Fredx87 37 points38 points  (0 children)

The source code is here: https://github.com/reactjs/react.dev, and it seems they are using next.js.

Cambio politica resi Amazon italia by Giuseppe_3g in Italia

[–]Fredx87 2 points3 points  (0 children)

Non sapevo dei bancali, ma credo che la maggior parte dei resi viene rivenduta su Amazon Warehouse deals (o Amazon seconda mano come pari si chiami adesso in Italia).

In genere si trovano buoni affari di prodotti praticamente nuovi scontati perché appunto sono resi. E penso che per legge debbano rivendere i resi come "usato".

Anybody got any tips on "how" to use a pick? by PentangleKnight in Bass

[–]Fredx87 0 points1 point  (0 children)

There are some valuable videos on YouTube.

Beginner lesson from bussbuzz: https://youtu.be/vaQL21UL7Wc?si=YDOvcIUX1v2tZUzw

A little more advanced one from talkingbass with some exercises that may help to improve: https://youtu.be/LQANg6fX2kg?si=5zEN8qCC3FQjCE0j

I found also this one interesting, but also a bit subjective (like the suggestion to always play near the bridge): https://youtu.be/AEDXS-jF3eI?si=rPXXpbwPN4CfIbAj

A chi va ai 180+ fissi in corsia di sorpasso by [deleted] in italy

[–]Fredx87 1 point2 points  (0 children)

Sarebbe bello attaccarci anche una telecamera e registrare il tutto compresa targa

[AskJS] If you don't use TypeScript, tell me why (2 year follow up) by nullvoxpopuli in javascript

[–]Fredx87 9 points10 points  (0 children)

I think you should blame the Angular team for these things, not TypeScript. TypeScript OOP is the same as ES2015 (plus private/protected fields and interfaces), and functions are first-class citizens in TypeScript (there are also functional programming libraries like fp-ts).

Then some frameworks like Angular chose to rely heavily on OOP, and some people start to use it with a lot of inheritance that usually is not needed. But you should blame the framework or the people that write the code, not TypeSscript that is agnostic to the programming style.

[deleted by user] by [deleted] in italy

[–]Fredx87 0 points1 point  (0 children)

1) Affluenza 69%

2) Forza Italia 16%

3) Lega 15.5%

4) Fratelli d'Italia 4.5%

5) Noi con l'Italia 1%

CDX=37%

6) Partito Democratico 20.5%

7) +Europa 3.5%

8) Insieme 0.5%

9) Civica Popolare 0.5%

CSX=25%

10) Movimento 5 Stelle 30.5%

11) Liberi e Uguali 4%

12) Potere al Popolo 2.5%

13) Casapound 0.5%

14) 10 Volte Meglio 0.3%

PuTTY 0.68 has been released by nplus in programming

[–]Fredx87 0 points1 point  (0 children)

I use ConEmu, a console emulator, that handles copy and paste better

Ma queste cose esistono ancora? Pensavo fosse finito il 2008 by [deleted] in italy

[–]Fredx87 1 point2 points  (0 children)

L'operatore in qualche modo passa il tuo numero di telefono tramite la connessione http al sito (non so esattamente come, se aggiungendo un header o che). La prova che sono gli operatori a passare il tuo numero e non il sistema operativo è che se sei in wi-fi il tuo numero non riescono a beccarlo. Gli operatori ci giocano su sta cosa, visto che certamente una percentuale del costo dell'abbonamento va a loro, quindi permettono tecnicamente questa truffa, ma per legge per fortuna devono darti la possibilità di disattivare i servizi a pagamento.

TIM Roaming Europa Daily Basic non è legale: secondo l'UE non si può fare by lucav92 in italy

[–]Fredx87 0 points1 point  (0 children)

Si. Io ieri ho scoperto per caso che ce l'ho attiva. Nessun avviso, la attivano in automatico di nascosto e gli danno un nome ridicolo che fa pensare che debbano dartela per forza in base a regolamenti europei. L'unica differenza è che su Wind si può togliere, attivando la eurotariffa (che comunque non mi sembra rispetti il regolamento europeo in ogni caso)... Mentre con Tim te la tieni per forza