import { createSelector } from 'reselect';

/**
 * Direct selector to the edit state domain
 */
const selectEditDomain = () => (state) => state.get('weChatRichmediaEdit');
const selectTemplatesDomain = (state) => state.get('templates');

/**
 * Other specific selectors
 */
const makeSelectTemplates = () => createSelector(
  selectTemplatesDomain,
  (globalState) => globalState.toJS()
);

/**
 * Default selector used by Edit
 */

const makeSelectEdit = () => createSelector(
  selectEditDomain(),
  (substate) => substate.toJS()
);

export default makeSelectEdit;
export {
  selectEditDomain,
  makeSelectTemplates,
};
