Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement