The code powering m.abunchtell.com https://m.abunchtell.com
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

40 行
834 B

  1. import { SETTING_CHANGE } from '../actions/settings';
  2. import { STORE_HYDRATE } from '../actions/store';
  3. import Immutable from 'immutable';
  4. const initialState = Immutable.Map({
  5. home: Immutable.Map({
  6. shows: Immutable.Map({
  7. reblog: true,
  8. reply: true
  9. })
  10. }),
  11. notifications: Immutable.Map({
  12. alerts: Immutable.Map({
  13. follow: true,
  14. favourite: true,
  15. reblog: true,
  16. mention: true
  17. }),
  18. shows: Immutable.Map({
  19. follow: true,
  20. favourite: true,
  21. reblog: true,
  22. mention: true
  23. })
  24. })
  25. });
  26. export default function settings(state = initialState, action) {
  27. switch(action.type) {
  28. case STORE_HYDRATE:
  29. return state.merge(action.state.get('settings'));
  30. case SETTING_CHANGE:
  31. return state.setIn(action.key, action.value);
  32. default:
  33. return state;
  34. }
  35. };