Skip to content

Instantly share code, notes, and snippets.

@McCulloughRT
Created October 11, 2017 00:18
Show Gist options
  • Save McCulloughRT/6096a84ae457b264281cb0907b5db65e to your computer and use it in GitHub Desktop.
Save McCulloughRT/6096a84ae457b264281cb0907b5db65e to your computer and use it in GitHub Desktop.
// Within your actions
export function setStyle(style) {
return {
type: 'SET_STYLE',
payload: style
}
}
/* ----------------------------*/
// Within your reducers
export default function StylesheetReducer(styleState = null, action) {
switch(action.type){
case 'SET_STYLE': {
return Immutable.fromJS(action.payload);
}
default: return styleState;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment