Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should dispatch a redux-undo .redo() action ', () => {
const { getState, dispatch } = setup();
const thunk = redoLayoutAction();
thunk(dispatch, getState);
expect(dispatch.getCall(0).args[0]).toEqual(UndoActionCreators.redo());
// redo/undo should trigger action for dashboardFilters
expect(dashboardFilters.updateLayoutComponents.callCount).toEqual(1);
});
const onPressEndB = event => {
// to relay through state machine instead:
// interactionService.send({ type: 'PRESS_END_B', controller: event.target })
if (canRedo && interactionService.state.value !== "character_posing") {
dispatch(ActionCreators.redo())
playSound('redo')
}
}
_onKeyUp (e) {
const {store} = this.context;
const {controls} = this._state;
// don't react on shortcuts if inactive or minimized
if (!controls.isActive || controls.isMinimize) { return; }
// don't react if `alt` key is not set
if ( !e.altKey ) { return; }
switch (e.which) {
// z
case 90: { return store.dispatch(ActionCreators.undo()); }
// x
case 88: { return store.dispatch(ActionCreators.redo()); }
// d
case 68: { return store.dispatch({ type: 'POINT_DELETE' }); }
// \
case 220: { return e.shiftKey && this._tryToReset(store); }
}
}
redo={() => {this.dispatchAndSetState(ActionCreators.redo());}}
visor={() =>{this.setState({ visorVisible: true });}}
historyForward() {
let { dispatch } = this.props;
dispatch(ActionCreators.redo());
}
<button> props.dispatch(ActionCreators.redo())}>Redo</button>
redo() {
dispatch(undoActions.redo())
},
clearHistory() {
onRedo: () => dispatch(UndoActionCreators.redo())
});
onClick={() => dispatch(ActionCreators.redo())}
icon={}
onClick={() => dispatch(ActionCreators.redo())}
icon={}