SHARE
TWEET

Untitled

a guest Jul 20th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {
  2.   SELECT_MIDI_CONTROLLER,
  3.   SELECT_NUMBER_OF_KEYBOARD_OCTAVES,
  4.   SET_WEB_MIDI_SUPPORTED,
  5. } from './action-types';
  6.  
  7. export const initialState = {
  8.   selectedDeviceName: 'APC Key 25',
  9.   webMidiSupported: false,
  10. };
  11.  
  12. function seePianoKeyApp(state = initialState, action) {
  13.   switch (action.type) {
  14.     case SELECT_MIDI_CONTROLLER:
  15.       return {
  16.         ...state,
  17.         selectedDeviceName: action.selectedDeviceName
  18.       };
  19.     case SELECT_NUMBER_OF_KEYBOARD_OCTAVES:
  20.       return {
  21.         ...state,
  22.         numberOfKeyboardOctaves: action.numberOfKeyboardOctaves
  23.       }
  24.     case SET_WEB_MIDI_SUPPORTED:
  25.       return {
  26.         ...state,
  27.         webMidiSupported: action.webMidiSupported,
  28.       };
  29.     default:
  30.       return state;
  31.   }
  32. }
  33.  
  34. export default seePianoKeyApp;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top