Skip to content

Instantly share code, notes, and snippets.

@alyssaBiasi
Last active August 19, 2016 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alyssaBiasi/c00f3c411a7385e5b773f182fc4b0884 to your computer and use it in GitHub Desktop.
Save alyssaBiasi/c00f3c411a7385e5b773f182fc4b0884 to your computer and use it in GitHub Desktop.
class FeatureToggleStore extends MapStore {
getInitialState() {
return { featureToggles: {} };
}
reduce(state, payload) {
const { action } = payload;
switch (action.type) {
case Actions.FEATURE_TOGGLES_UPDATED:
const featureToggles = {
...state.featureToggles,
...action.data
};
return { featureToggles };
default:
return state;
}
}
getFeatureToggles() {
return this.getState().featureToggles;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment