Skip to content

Instantly share code, notes, and snippets.

@talkol
Last active October 14, 2016 19:47
Show Gist options
  • Select an option

  • Save talkol/2f1268c6d1e1711e6d6b7f59f5ae9413 to your computer and use it in GitHub Desktop.

Select an option

Save talkol/2f1268c6d1e1711e6d6b7f59f5ae9413 to your computer and use it in GitHub Desktop.
import * as types from './actionTypes';
import Immutable from 'seamless-immutable';
const initialState = Immutable({
topicsByUrl: undefined,
selectedTopicUrls: []
});
export default function reduce(state = initialState, action = {}) {
switch (action.type) {
case types.TOPICS_FETCHED:
return state.merge({
topicsByUrl: action.topicsByUrl
});
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment