rdac - Redux: Action Creator (Preferred approach)
export const actionCreator = (payload) => {
return {
type: 'ACTION_TYPE',
payload
}
};
action - Redux: Dispatch Action (Preferred Async Await approach)
export const = () => {
return async dispatch => {
try {
} catch (e) {}
};
};
rdat - Redux: Const of Action Type
export const ACTION_NAME = 'ACTION_NAME';
store - Redux: Store
import { reducerName } from './reducer'
import { createStore } from 'redux'
const store = createStore(reducerName)
export default store
provider - Redux: Provider from React-Redux
<Provider store={store}>
Component
</Provider>
rdr - Redux: Reducer (Preferred Approach)
const initialState = {}
const reducerName = (state = initialState, action) => {
const newState = { ...state };
if (action.type === 'ACTION_TYPE'){
// return something
} else {
return newState
};
};
export default reducerName;
rxreducer - Redux: Reducer
const initialState = {};
export default (state = initialState, { type, payload }) => {
switch (type) {
case first:
return { ...state, ...payload };
default:
return state;
}
};
rdcr - Redux: Combine Reducer
import { combineReducers } from 'redux';
import reducerName from 'reducerPath';
export default combineReducers({
});
selector - Redux: Select
export const selectorName = createSelector(
[filter1, filter2]
(filter1, filter2) => {
}
)
rxselect - Redux: Select
import { createSelector } from 'reselect';
export const first = (state) => state.second;