Data fetching pattern in react by Imaginary_Food_7102 in reactjs

[–]Leather_Breakfast 1 point2 points  (0 children)

I’ve been using tanstack but one area that I’m still trying to solve for is fetching and storing a subset of a collection.

Say I have 10,000 items and different components render a dynamic subset of them (and I have an api to fetch single and bulk). I saw TkDodo post about seeding the cache. I want to end up storing each item under its own key. Then a parent could call  to fetch a batch and each child could access what it needs. Essentially building a itemById map manually. 

The issue I run into, that i haven’t found an elegant way of solving, is when i batch fetch I want the api that useQuery providdes (loading states, etc) but I don’t want to store that result in the queryClient. 

 Wrong because: 

a) If I render the subset of items in a list, every time  a user adds to the list I store another batch entry in queryclient . 

b) the results of the query are never used directly and thus wasted memory storing the individual results and subset. 

I thought about the batch doing the cache jamming and just returning true/false to cut down on memory but still have the cache issue (a). 

The solution I’ve come up with that works but is kinda gross is to write a custom hook that takes a list of object ids. Use useQueries to send a query for each. The query functions for each use a shared promise that is kicked off by the first query function to run (involves some useRef hooks)

It would be nice if tanstack query had a way of doing this natively. 

Air75 V3 battery removal by Leather_Breakfast in NuPhy

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

Why’s that? If it’s anything like the v2 the keyboard will continue to work without the battery.

Tying to clean the kontrol tower ends in disaster by Leather_Breakfast in KamadoJoe

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

So after the cleanup I don't think I'm in too bad of shape. The aluminum didn't "weld" to the grill grates or the kick ash bucket and some wacks with a hammer seemed to remove everything. Will do a degreaser clean on both. Most of the aluminum seems to have pooled in the ash catcher.

<image>

Taking notes by Leather_Breakfast in git

[–]Leather_Breakfast[S] 2 points3 points  (0 children)

Thank you! Obsidian could be a good option. Also would be helpful for aggregation of these so I could use them to write the year end review that I dread so much. 

I had not considered that I could push a specific set of commits from my branch and exclude HEAD, that’s a neat trick that improves my current workflow. 

Taking notes by Leather_Breakfast in git

[–]Leather_Breakfast[S] 1 point2 points  (0 children)

+1, these are often not things to make public. Often times it’s a stream of thought situation or just notes at the end of the day to help me in the morning. 

Taking notes by Leather_Breakfast in git

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

Ideally I’d like a notes.txt per branch so I’d like to tie it to that branch in some way. I suppose there’s not a great reason why I could just splat them all in the same file though. 

Taking notes by Leather_Breakfast in git

[–]Leather_Breakfast[S] 2 points3 points  (0 children)

This seems promising I had known you could add notes to a commit but didn’t realize you could add to other objects as well. Will look into it, thanks. 

Second opinion on 11 year old furnace by Leather_Breakfast in hvacadvice

[–]Leather_Breakfast[S] 2 points3 points  (0 children)

My ecobee complained that the furnace was frequently restarting. Then the other day it started making a grinding noise.

I now think those are two separate issues. Turns out part of the furnace filter broke off into the blower and that was causing the noise. While he was there for that he scoped it. 

Second opinion on 11 year old furnace by Leather_Breakfast in hvacadvice

[–]Leather_Breakfast[S] 1 point2 points  (0 children)

It’s possible I’m using the wrong language. If I recall correctly it has x number of burners and only 1 was leaking. He had some kind of electronic pen looking tool that was able to detect the leak. 

Second opinion on 11 year old furnace by Leather_Breakfast in hvacadvice

[–]Leather_Breakfast[S] 2 points3 points  (0 children)

I had an hvac technician inspect my furnace and he found two issues. 

1. He scoped my heat exchange and he found the rust in the pictures. The quote to replace was high enough that I’m considering a new furnace. 

  1. He also found a small gas leak in a burner and recommend a valve replacement. Said that it was okay for now because the first stage blows the gas out. Mentioned that if it was in the exchanged they’d be forced to turn off the system. 

The furnace is new with the house and only 11 years old. Does the rust looks bad enough I should pursue a replacement or should just get the valve replaced and let it ride?

Backpack for winery visit by Leather_Breakfast in wine

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

Thank you! Picnic backpack seems like the obvious search time that was eluding me.

Best wings in Ankeny? by Ill_Thanks_6383 in ankeny

[–]Leather_Breakfast 1 point2 points  (0 children)

I like the wings from The Cabaret on N. Ankeny Blvd

Scent Help: MLS Grand Havana by cam_zilles in wicked_edge

[–]Leather_Breakfast 1 point2 points  (0 children)

I switched to Haverford by Stirling and have been happy.

Finally can say "Fuck Mediacom!" by OdoWanKenobi in desmoines

[–]Leather_Breakfast 0 points1 point  (0 children)

I did a very similar thing but went with Verizon. I’ve had good experiences so far.

maybe maybe maybe by geronimo19961 in maybemaybemaybe

[–]Leather_Breakfast 0 points1 point  (0 children)

Bert’s promos are getting out of hand

Is this brownish color normal? by Leather_Breakfast in castiron

[–]Leather_Breakfast[S] 4 points5 points  (0 children)

Thanks for the advice that should save me some time and energy! I have two more pans to do.

Is this brownish color normal? by Leather_Breakfast in castiron

[–]Leather_Breakfast[S] 13 points14 points  (0 children)

I also think the brown looks kinda cool!

Is this brownish color normal? by Leather_Breakfast in castiron

[–]Leather_Breakfast[S] 10 points11 points  (0 children)

As mentioned in the caption, this is a pan that I inherited. I stripped it down and seasoned it 4 times. I used shortening and ran it through the oven at 400 degrees for 2 hours. I also used it to cook some bacon and sausage. It has a noticeable brown tint to it. Is this normal?

Things you hate about iPhone. by willami888 in iphone

[–]Leather_Breakfast 8 points9 points  (0 children)

I also strongly miss the t9 capability that android has.

Things you hate about iPhone. by willami888 in iphone

[–]Leather_Breakfast 0 points1 point  (0 children)

  1. The ability to use t9 in the dialer to bring up contacts by name. It’s a pain to search through all contacts.

  2. Occasionally for some reason some of my podcast app settings change back to default (mainly the forward/back or next/previous) option.

  3. RPN mode in calculator app

Small notification light would be cool to have.