tgxn / lemmy-modder

A moderation tool for Lemmy
https://modder.lemmyverse.net/
MIT License
12 stars 3 forks source link

Feature: Auto Refresh #106

Open tgxn opened 11 months ago

tgxn commented 11 months ago

What do you want to see? Setting options for auto-refresh:

Additional context so that the counts update when i get new things....

could also look at implementing browser notifications when:

Pdzly commented 11 months ago

This could be easily be implemented with redux-toolkit ( https://redux-toolkit.js.org/rtk-query/usage/queries ) and with automatic polling feature of such queries ( https://redux-toolkit.js.org/rtk-query/usage/polling ) or do you have already something in mind?

tgxn commented 11 months ago

yep, exactly. there are currently cache and stale timers that are just set to infinite https://github.com/tgxn/lemmy-modder/blob/main/src/hooks/useLemmyHttp.js#L42C9-L42C14

mainly need the additional setting ui and then read it to load the value for the correct stale time in each component that uses useLemmyHttp

Pdzly commented 11 months ago

Ahhh ok, you do the useQuery from redux. (I think it ) Could be simplified with the redux-toolkit createAPI. But both are good options ;)