Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

reducer.js 455B

12345678910111213141516171819202122232425
  1. // @flow
  2. import {
  3. PROFILE_UPDATED
  4. } from './actionTypes';
  5. import { ReducerRegistry } from '../redux';
  6. const DEFAULT_STATE = {
  7. profile: {}
  8. };
  9. const STORE_NAME = 'features/base/profile';
  10. ReducerRegistry.register(
  11. STORE_NAME, (state = DEFAULT_STATE, action) => {
  12. switch (action.type) {
  13. case PROFILE_UPDATED:
  14. return {
  15. profile: action.profile
  16. };
  17. }
  18. return state;
  19. });