tgxn / lemmy-modder

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

Visibility Improvement #66

Closed Pdzly closed 11 months ago

Pdzly commented 12 months ago

I have

  1. Use Selector variables:

https://github.com/tgxn/lemmy-modder/blob/2733ec16a32f7e22c5b1db6d7c136a5fc21ae594/src/App.jsx#L30-L31

Instead of:

const currentUser = useSelector((state) => state.accountReducer.currentUser);

use:

(In reducer file):

export const selectCurrentUser = (state) => state.accountReducer.currentUser);

(usage):

// Import selectCurrentUser of course
const currentUser = useSelector(selectCurrentUser);
  1. Use RTK ( redux-toolkit ) reducers/slice:

https://redux-toolkit.js.org/api/createSlice It improves the quality of reducers a lot.

Those are just minor improvements, that i could recommend doing.

(Personally i wouldnt do this in js rather in ts, so its more predictable if someone else contributes to it but that is just personal oppinion)

Pdzly commented 12 months ago

I can implement those in a pull request. If you want it but are too busy doing other features. Just let me know.

tgxn commented 12 months ago

absolutely happy for you to mate!

anything else you think that could be improved, too 👍

Pdzly commented 12 months ago

Ok i will make a PR with those changes. Then you can see what i would have imagined. If you want i could make the transformation to typescript too but it would be a huge change for you, so i wont do that for now.

Thanks! And good job with everything!

tgxn commented 11 months ago

Looks great mate, I'll merge it into develop and give it a test when I have some time - probably tonight :D

tgxn commented 11 months ago

closed since this is all merged in!

if you want to help on anything else, let me know, or submit a PR :D

Pdzly commented 11 months ago

This wasnt fully done but yeah i forgot to put a "Part 1" in the title XD

tgxn commented 11 months ago

This wasnt fully done but yeah i forgot to put a "Part 1" in the title XD

Invited you as a collaborator, please feel free to create/update tickets mate.

tgxn commented 11 months ago

There's def. more we could do here,