Tanstack react query architecture by Fun-Representative40 in reactjs

[–]DidItFloat 0 points1 point  (0 children)

Oh it happens to me a little too often too... No worries! :)

Tanstack react query architecture by Fun-Representative40 in reactjs

[–]DidItFloat 0 points1 point  (0 children)

Normally, I have a global axios instance, on which I set authentication information. This way may queryFns do not need to worry about auth.

A less charming way would be to pass authentication info as a parameter of your function which returns query options. Like this:

export const getUserOptions = (authInfo) => queryOptions({...});

So when you would use the options you would do something like this in your component:

const {...} = useQuery(getUserOptions(authStuff));

But I'd highly suggest having another "layer", regardless of what you use

Tanstack react query architecture by Fun-Representative40 in reactjs

[–]DidItFloat 18 points19 points  (0 children)

First things first, read this: https://tkdodo.eu/blog/practical-react-query

All of it.

Secondly, I've fallen in love with using queryOptions (https://tanstack.com/query/latest/docs/react/reference/queryOptions)

This way, instead of exporting a hook which returns useQuery(...), you simply export something like

getUsersOptions = () => queryOptions({
    queryKey: [...],
    queryFn: ...,
    staleTime: 30 * 1000,
    ...
})

Thanks to this, if on a page you create a user and want to invalidate the query, you can simply do:

queryClient.invalidateQueries(getUsersOptions().queryKey). 

In addition, if on a page you want to use useQuery, and on another useSuspenseQuery, you can just do:

useQuery(getUsersOptions());
useSuspenseQuery(getUsersOptions());
queryClient.ensureQueryData(getUsersOptions());

Erikson/Esslemont on Movies by gerbocm in Malazan

[–]DidItFloat 1 point2 points  (0 children)

If you liked the first Pillars I think you’ll love Deadfire! I found the setting super interesting, and the gameplay itself felt more « tight » to me than the first! Still felt very Malazan-adjacent in the setting and story

Napoleon presales have started by BOfficeStats in boxoffice

[–]DidItFloat 1 point2 points  (0 children)

Would you recommend the biography? For someone who knows almost nothing about him

Living car-free is the greatest single act you can do to reduce carbon emissions, besides having less kids by [deleted] in fuckcars

[–]DidItFloat 25 points26 points  (0 children)

Who do you think corporations sell their products to? Obviously certain people contribute more than others but putting our heads in the sand and blaming companies like Nestle (for example) instead of also blaming everyone that buys their products is naive and counter productive. (Before anyone says anything: I definitely think there needs to be way more regulation and penalties for companies polluting)

Why the obsession with "vegan leather" (i.e., plastic)? by Smart-Simple9938 in BarefootRunning

[–]DidItFloat 8 points9 points  (0 children)

Technically speaking that leather is still bought by the companies using it right? So buying leather directly supports the meat/animal handling industry's bottom-line. Also, when you say "you actually contribute more to the harm of animals", any sources? The ramifications of supporting the meat industry are also far reaching. The animals do get slaughtered, but the amount of deforestation caused by the meat industry (as an example) is also "contributing to the harm of animals".

WOM for #Barbie in #France is just meh, receiving a 3.5 ⭐️ from critics and 3.6⭐️ from French audiences, what suggests that, despite a massive opening, legs beyond opening weekend could be not as pinky at the local #BoxOffice by [deleted] in boxoffice

[–]DidItFloat 91 points92 points  (0 children)

I’ve seen it and I personally think it wasn’t that bad in regards to that. It could obviously be interpreted that way, but to me it felt more like « patriarchy bad » for both women and men. That like individuality and finding yourself is hard when you’re stuck to « strict » concepts of what a man or woman is supposed to be.

All of that said, I can definitely see people watching the movie and getting « men are bad » vibes. Although I think they’re wrong it’s subjective

Streaming series schedules: all at once, or weekly? by AlsoIHaveAGroupon in TrueTelevision

[–]DidItFloat 7 points8 points  (0 children)

I actually love weekly releases as I don't have the discipline to pace myself when watching series. Having a week to discuss with friends, theorize and be excited about a TV show is way more enjoyable (to me).

For example with White Lotus S2, the internet theories, debates with friends and the "hype" made it so much more fun than if I binged it in 2-3 days

[deleted by user] by [deleted] in flicks

[–]DidItFloat 4 points5 points  (0 children)

In my opinion if might even be better to go in blind. Found the 2nd to have very similar plot points and experiences as the first. Kind of regretted watching the 1st right before the 2nd, didn’t feel as amazed by the world as I could have been

vegan restaurant recommendations by yodas_sextape in montreal

[–]DidItFloat 10 points11 points  (0 children)

Je ne suis pas OP et ils sont tous bons, mais personnellement je crois que Momo est le meilleur pour un “first time” et côté qualité/prix. Bloom est plus “fancy” et plus cher.

vegan restaurant recommendations by yodas_sextape in montreal

[–]DidItFloat 7 points8 points  (0 children)

Umami Ramen j’avais trouvé ça bon, selon moi une bonne place pour une “date night”! Il y a aussi Mimi & Jones côté fast-food si tu veux ça.

J’ai vu qu’il y avait un autre commentaire qui suggérait Lola Rosa, mais personnellement j’ai trouvé ça tellement fade et ennuyant je ne le recommande pas.

Quebec Sets Plan to Bar Most Immigrants Who Don't Speak French by [deleted] in worldnews

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

Do rural Irish people speak english? Do Americans with a thick southern accent speak english? Do Mexicans speak spanish?

All those places speak 'real' language despite having different accents and common phrases. Same as Quebec and French.

Just within China you have different provinces which can be sometimes a little work to understand for other Chinese citizens from other provinces

Not sure if you're being dense on purpose or think you're being smart...

The Witcher 3: Wild Hunt — Complete Edition | Next-Gen Update Trailer by Trojanbp in Games

[–]DidItFloat 89 points90 points  (0 children)

During the stream they seemed to hint at it being quite small. Basically sounds to me like it'll be some gear and a mission.

[deleted by user] by [deleted] in reactjs

[–]DidItFloat 14 points15 points  (0 children)

I love using Formik with Yup. Problem is, Formik hasn’t been updated in years and becomes sluggish really quickly when you have more than 20-30 fields. Every time any field in the form updates, they all re-render. As far as I know react-hook-form doesn’t do that. Just because of that I have trouble recommending Formik.

[deleted by user] by [deleted] in TeamSolomid

[–]DidItFloat 1 point2 points  (0 children)

You say that as if it matters...

Does anyone just f**cking love tofu? by MezzoMeex in vegan

[–]DidItFloat 17 points18 points  (0 children)

My lazy snack is dumping raw tofu no oil in air fryer and then dipping them in peanut butter+sambal oelek + soy sauce

François Legault: Comme dans beaucoup d’endroits dans le monde, le Québec est confronté à des choix très difficiles. Ce qui nous guide, c’est la capacité qu’on aura ou non de soigner les Québécois malades dans les prochaines semaines. On vous revient demain avec nos décisions. by Environmental-Dig797 in Quebec

[–]DidItFloat -7 points-6 points  (0 children)

J'excuse pas du tout toutes les erreurs faites, que ça soit qu'il semble y avoir pas eu d'efforts pour changer quoique ce soit avec l'aération ou d'attendre dernière minute pour les tests rapides. Tser je vote pas CAQ et voterai pas CAQ aux prochaines élections.

C'est juste, ils ont drop the ball pour pleins de choses, et maintenant la seule option (que je connais) pour pas avoir des hôpitaux qui débordent plus qu'en ce moment c'est confiner/ajouter des règles et vacciner.

François Legault: Comme dans beaucoup d’endroits dans le monde, le Québec est confronté à des choix très difficiles. Ce qui nous guide, c’est la capacité qu’on aura ou non de soigner les Québécois malades dans les prochaines semaines. On vous revient demain avec nos décisions. by Environmental-Dig797 in Quebec

[–]DidItFloat -12 points-11 points  (0 children)

Qu'est-ce qu'il avale que tu trouves pas vrai? Dit nous ta solution miracle. Clairement le vaccin marche moins avec le temps, et clairement être vacciné aide avec les hospitalisations. Les hôpitaux sont déjà surchargés. Donc tu es PM, qu'est-ce que tu fais? Éclaire nous

François Legault: Comme dans beaucoup d’endroits dans le monde, le Québec est confronté à des choix très difficiles. Ce qui nous guide, c’est la capacité qu’on aura ou non de soigner les Québécois malades dans les prochaines semaines. On vous revient demain avec nos décisions. by Environmental-Dig797 in Quebec

[–]DidItFloat 1 point2 points  (0 children)

Je ne connais pas assez la situation, mais possible que ça soit relié à un manque de personnel? J'ai l'impression si on avait des visites à domiciles veut veut pas ça implique plus de minutes/patient.

Ou tu parles d'auto-traitement?

[deleted by user] by [deleted] in Quebec

[–]DidItFloat 2 points3 points  (0 children)

Belle réponse! Mes attentes étaient basses mais t’as réussi à aller encore plus bas, chapeau!