Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/toolbar/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ const initialState = [
}
];

/**
* Sub-reducer for a single toolbar button. On CLICK_BUTTON, toggles the
* `toggled` flag if the action targets this button and the button supports
* toggling (i.e. `toggled` is defined). Returns the button unchanged otherwise.
*
* @param {Object} toolbarButton - A single button entry from the state array.
* @param {Object} action - The dispatched Redux action.
* @returns {Object} The next state for this button.
*/
const toolbarButtonReducer = (toolbarButton, action) => {
switch (action.type) {
case t.CLICK_BUTTON:
Expand Down
Loading