UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

21 lines 555 B
import { AnalyticPluginTypes } from './actions'; import { defaultState } from './types'; export const reducer = (state, action) => { switch (action.type) { case AnalyticPluginTypes.UpdateRowOrColumnMovedAction: return { ...state, rowOrColumnMoved: { ...state.rowOrColumnMoved, ...action.data } }; case AnalyticPluginTypes.RemoveRowOrColumnMovedAction: return { ...state, rowOrColumnMoved: defaultState.rowOrColumnMoved }; default: return state; } };