import {createReducer} from 'redux-starter-kit';
import {setApplicationReady} from '../actions/common_actions';

export const createCommonReducer = (platform, appPlatform, version) => {
  return createReducer({
    AppPlatform: appPlatform,
    AppReady: false,
    Platform: platform,
    Version: version,
  }, {
    [setApplicationReady]: (state, action) => {
      return {
        ...state,
        AppReady: action.payload,
      };
    }
  });
};