a2n-seattle / a2n-seattle/rms-app

Create Constants Redux Slice

Open
#225 0 comments 0 reactions 0 assignees View on GitHub
task
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
27m
Merged PRs (30d)
4

Description

Story Points: 1-2

# How?

This is another one for anyone courageous enough to delve into my Redux stuff (it's really not that bad).

What we need is another Redux slice, but this one is a relatively simple one. All it needs to do is hold all the constants that we use in our app in a single place. To do this, just duplicate the counterSlice.js file, and change the initialState variable to include all the constants we use throughout our app (within reason). It doesn't need any functions, as the state will never change. This means setting the functions and asyncFunctions properties in the layout to be an empty object ( {} ).

Make sure that you change the slice "name" variable to something like: "constants", and also make sure to add something like: "constants: constantsSlice" to the store.js, depending on what you called everything.

Then, use the useReduxSliceProperty function in all the places the constants were used to access them. Feel free to read the documentation on useReduxSliceProperty and some of the other places I've called it to get an idea of how to use it

If you have any questions, let me (NavigSB) know. I realize that this is a new part of React for everyone, so if you need me to peer program it with you, I am happy to :)

Also, while you're at it, add a furniture category for the Items. Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.