[DE mobile] Remove actions and redusers for redux
This commit is contained in:
parent
663e373ccf
commit
2408567cb6
|
@ -1,9 +0,0 @@
|
|||
import React from "react";
|
||||
import { resetPageOrient } from "../store/actions/actions";
|
||||
|
||||
export default function (dispatch, getState, api) {
|
||||
// document settings
|
||||
api.asc_registerCallback('asc_onPageOrient', (isPortrait) => {
|
||||
dispatch(resetPageOrient(isPortrait === true));
|
||||
});
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
import registerApi from '../ApiRegisterCallback';
|
||||
|
||||
export const INIT_API = 'INIT_API';
|
||||
export const initApi = value => {
|
||||
return (dispatch, getState) => {
|
||||
registerApi(dispatch, getState, value);
|
||||
dispatch({
|
||||
type: INIT_API,
|
||||
api: value
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// action of settings
|
||||
export const RESET_PAGE_ORIENT = 'RESET_PAGE_ORIENT';
|
||||
export const resetPageOrient = value => {
|
||||
return {
|
||||
type: RESET_PAGE_ORIENT,
|
||||
isPortrait: value
|
||||
}
|
||||
};
|
||||
export const changePageOrient = (value) => {
|
||||
return (dispatch, getState) => {
|
||||
const { api } = getState();
|
||||
if (api.apiObj) {
|
||||
api.apiObj.change_PageOrient(value);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
// action types
|
||||
export const RESET_PAGE_ORIENT = 'RESET_PAGE_ORIENT';
|
||||
|
||||
// action creators
|
||||
export const resetPageOrient = value => {
|
||||
return {
|
||||
type: RESET_PAGE_ORIENT,
|
||||
isPortrait: value
|
||||
}
|
||||
};
|
|
@ -1,12 +0,0 @@
|
|||
import { INIT_API } from '../actions/actions'
|
||||
|
||||
const apiReducer = (state = [], action) => {
|
||||
if (action.type == INIT_API) {
|
||||
return Object.assign({}, state, {
|
||||
apiObj: action.api
|
||||
});
|
||||
}
|
||||
return state;
|
||||
};
|
||||
|
||||
export default apiReducer ;
|
|
@ -1,12 +0,0 @@
|
|||
import { RESET_PAGE_ORIENT } from '../actions/actions'
|
||||
|
||||
const settingsReducer = (state = [], action) => {
|
||||
if (action.type == RESET_PAGE_ORIENT) {
|
||||
return Object.assign({}, state, {
|
||||
isPortrait: action.isPortrait
|
||||
});
|
||||
}
|
||||
return state;
|
||||
};
|
||||
|
||||
export default settingsReducer ;
|
Loading…
Reference in a new issue