0

I am new to JS with react+redux framework and I have a code that as follows in reducer code.

export const operationState = (state = someState, action = {}) => {
    //some case handler 
}

Please help me in understanding what will this translates to.

1 Answer 1

2

It exports a function named operationState with the parameters state and action, that both default to someState and {} if nothing is passed in when you call operationState()

Sign up to request clarification or add additional context in comments.

1 Comment

Actually it exports a constant with a reference to a function, but why the do that instead of simply writing export function is beyond me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.