frankcollins3 / fill_container

codecamp team project updated with new icon screen menu + puppeteer icon search, GraphQL, redux, relational psql !mongo, and accuweatherAPI
1 stars 0 forks source link

REDUX promises || plain object error [10:31pm] #52

Open frankcollins3 opened 1 year ago

frankcollins3 commented 1 year ago

Screen Shot 2023-05-26 at 10 29 21 PM

heres the function I'm currently working with:

 const TOGGLE_SETTINGS = async (setting) => {
        count++

        if (setting === undefined || !setting ) {
            return {
                type: "TOGGLE_SETTINGS",
                payload: true
            }
        } else {
            return {
                type: "TOGGLE_SETTINGS",
                payload: count % 2 === 0 ? false : true 
            }
        }
    }

note that: 👍 before I created a reducer, and linked redux up to: {mapStateToProps} {mapDispatchToProps} TOGGLE_SETTINGS worked

👎 since connecting redux with those things, I am getting the above pictured error.

frankcollins3 commented 1 year ago

proposed approach: restart redux configuration

[11:06pm]