Search code examples
javascriptreactjsreact-reduxreact-router-redux

What does following statement does in js


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.


Solution

  • 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()