MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / getActions

Method getActions

packages/dnd-core/src/DragDropManager.js:45–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 }
44
45 getActions() {
46 const manager = this;
47 const { dispatch } = this.store;
48
49 function bindActionCreator(actionCreator) {
50 return (...args) => {
51 const action = actionCreator.apply(manager, args);
52 if (typeof action !== 'undefined') {
53 dispatch(action);
54 }
55 };
56 }
57
58 return Object.keys(dragDropActions).filter(
59 key => typeof dragDropActions[key] === 'function',
60 ).reduce((boundActions, key) => {
61 const action = dragDropActions[key];
62 boundActions[key] = bindActionCreator(action); // eslint-disable-line no-param-reassign
63 return boundActions;
64 }, {});
65 }
66}

Callers 2

constructorMethod · 0.80
constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected