remove deprecated property in KeyboardEvent
This commit is contained in:
		
							parent
							
								
									eff8d9a83e
								
							
						
					
					
						commit
						5ac1f60ece
					
				
					 10 changed files with 32 additions and 87 deletions
				
			
		| 
						 | 
				
			
			@ -1,23 +1,18 @@
 | 
			
		|||
import actions from '../actions';
 | 
			
		||||
 | 
			
		||||
const defaultState = {
 | 
			
		||||
  keys: [],
 | 
			
		||||
  keys: '',
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default function reducer(state = defaultState, action = {}) {
 | 
			
		||||
  switch (action.type) {
 | 
			
		||||
  case actions.INPUT_KEY_PRESS:
 | 
			
		||||
    return Object.assign({}, state, {
 | 
			
		||||
      keys: state.keys.concat([
 | 
			
		||||
        {
 | 
			
		||||
          code: action.code,
 | 
			
		||||
          ctrl: action.ctrl
 | 
			
		||||
        }
 | 
			
		||||
      ])
 | 
			
		||||
      keys: state.keys + action.key
 | 
			
		||||
    });
 | 
			
		||||
  case actions.INPUT_CLEAR_KEYS:
 | 
			
		||||
    return Object.assign({}, state, {
 | 
			
		||||
      keys: [],
 | 
			
		||||
      keys: '',
 | 
			
		||||
    });
 | 
			
		||||
  default:
 | 
			
		||||
    return state;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue