You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
791 B

import dragOffset from './dragOffset';
import dragOperation from './dragOperation';
import refCount from './refCount';
import dirtyHandlerIds from './dirtyHandlerIds';
import stateId from './stateId';
import { get } from '../utils/js_utils';
export default function reduce(state = {}, action) {
return {
dirtyHandlerIds: dirtyHandlerIds(state.dirtyHandlerIds, {
type: action.type,
payload: {
...action.payload,
prevTargetIds: get(state, 'dragOperation.targetIds', []),
},
}),
dragOffset: dragOffset(state.dragOffset, action),
refCount: refCount(state.refCount, action),
dragOperation: dragOperation(state.dragOperation, action),
stateId: stateId(state.stateId),
};
}