Removes redux compose utility function
This commit is contained in:
parent
a4a13bed84
commit
a59e691ba8
|
@ -54,9 +54,4 @@ declare module 'redux' {
|
||||||
declare function combineReducers<O: Object, A>(reducers: O): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;
|
declare function combineReducers<O: Object, A>(reducers: O): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;
|
||||||
|
|
||||||
declare function compose<S, A>(...fns: Array<StoreEnhancer<S, A>>): Function;
|
declare function compose<S, A>(...fns: Array<StoreEnhancer<S, A>>): Function;
|
||||||
|
|
||||||
// Utility function in Redux that can be used for function composition
|
|
||||||
// e.g. bar(foo(baz)) is equivalent to compose(bar, foo)(baz).
|
|
||||||
declare function compose(...fns: Array<Function>): Function;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import { compose } from 'redux';
|
|
||||||
|
|
||||||
import Recording from '../../../modules/UI/recording/Recording';
|
import Recording from '../../../modules/UI/recording/Recording';
|
||||||
import SideContainerToggler
|
import SideContainerToggler
|
||||||
from '../../../modules/UI/side_pannels/SideContainerToggler';
|
from '../../../modules/UI/side_pannels/SideContainerToggler';
|
||||||
import UIEvents from '../../../service/UI/UIEvents';
|
|
||||||
import UIUtil from '../../../modules/UI/util/UIUtil';
|
import UIUtil from '../../../modules/UI/util/UIUtil';
|
||||||
|
import UIEvents from '../../../service/UI/UIEvents';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
changeLocalRaiseHand,
|
changeLocalRaiseHand,
|
||||||
|
@ -19,7 +17,6 @@ import {
|
||||||
toggleFullScreen,
|
toggleFullScreen,
|
||||||
toggleToolbarButton
|
toggleToolbarButton
|
||||||
} from './actions.native';
|
} from './actions.native';
|
||||||
|
|
||||||
import { SET_DEFAULT_TOOLBOX_BUTTONS } from './actionTypes';
|
import { SET_DEFAULT_TOOLBOX_BUTTONS } from './actionTypes';
|
||||||
import { getDefaultToolboxButtons } from './functions';
|
import { getDefaultToolboxButtons } from './functions';
|
||||||
|
|
||||||
|
@ -40,7 +37,6 @@ export function checkAutoEnableDesktopSharing(): Function {
|
||||||
return () => {
|
return () => {
|
||||||
// XXX Should use dispatcher to toggle screensharing but screensharing
|
// XXX Should use dispatcher to toggle screensharing but screensharing
|
||||||
// hasn't been React-ified yet.
|
// hasn't been React-ified yet.
|
||||||
|
|
||||||
if (UIUtil.isButtonEnabled('desktop')
|
if (UIUtil.isButtonEnabled('desktop')
|
||||||
&& config.autoEnableDesktopSharing) {
|
&& config.autoEnableDesktopSharing) {
|
||||||
APP.UI.eventEmitter.emit(UIEvents.TOGGLE_SCREENSHARING);
|
APP.UI.eventEmitter.emit(UIEvents.TOGGLE_SCREENSHARING);
|
||||||
|
@ -60,8 +56,7 @@ export function dockToolbox(dock: boolean): Function {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = getState();
|
const { timeoutMS, visible } = getState()['features/toolbox'];
|
||||||
const { timeoutMS, visible } = state['features/toolbox'];
|
|
||||||
|
|
||||||
if (dock) {
|
if (dock) {
|
||||||
// First make sure the toolbox is shown.
|
// First make sure the toolbox is shown.
|
||||||
|
@ -89,10 +84,10 @@ export function dockToolbox(dock: boolean): Function {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function _getButtonHandlers(dispatch, getState) {
|
function _getButtonHandlers(dispatch, getState) {
|
||||||
const { isGuest } = getState()['features/jwt'];
|
const localRaiseHandHandler
|
||||||
|
= (...args) => dispatch(changeLocalRaiseHand(...args));
|
||||||
const localRaiseHandHandler = compose(dispatch, changeLocalRaiseHand);
|
const toggleFullScreenHandler
|
||||||
const toggleFullScreenHandler = compose(dispatch, toggleFullScreen);
|
= (...args) => dispatch(toggleFullScreen(...args));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
|
@ -127,8 +122,8 @@ function _getButtonHandlers(dispatch, getState) {
|
||||||
*/
|
*/
|
||||||
profile: {
|
profile: {
|
||||||
onMount: () =>
|
onMount: () =>
|
||||||
isGuest
|
getState()['features/jwt']
|
||||||
|| dispatch(setProfileButtonUnclickable(true))
|
|| dispatch(setProfileButtonUnclickable(true))
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,8 +149,7 @@ function _getButtonHandlers(dispatch, getState) {
|
||||||
*/
|
*/
|
||||||
recording: {
|
recording: {
|
||||||
onMount: () =>
|
onMount: () =>
|
||||||
config.enableRecording
|
config.enableRecording && dispatch(showRecordingButton())
|
||||||
&& dispatch(showRecordingButton())
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -366,8 +360,7 @@ export function showToolbox(timeout: number = 0): Object {
|
||||||
*/
|
*/
|
||||||
export function toggleSideToolbarContainer(containerId: string): Function {
|
export function toggleSideToolbarContainer(containerId: string): Function {
|
||||||
return (dispatch: Dispatch, getState: Function) => {
|
return (dispatch: Dispatch, getState: Function) => {
|
||||||
const state = getState();
|
const { secondaryToolbarButtons } = getState()['features/toolbox'];
|
||||||
const { secondaryToolbarButtons } = state['features/toolbox'];
|
|
||||||
|
|
||||||
for (const key of secondaryToolbarButtons.keys()) {
|
for (const key of secondaryToolbarButtons.keys()) {
|
||||||
const isButtonEnabled = UIUtil.isButtonEnabled(key);
|
const isButtonEnabled = UIUtil.isButtonEnabled(key);
|
||||||
|
|
Loading…
Reference in New Issue