I have a module which seems to be defined right, but for some reason it doesn’t get actions. Props for actions are undefined. I’ve checked - actions are defined and well if I log them from module’s index.js
but after that, they’re undefined in the container’s depsMapper
, it gets an empty object instead of object filled with actions. What could be the reason? What should I check?
myModule/actions/myActions.js:
export default { update({Meteor}) { // implementation }, }
myModule/actions/index.js:
`import myActions from ‘./myActions’;
const actions = {
myActions
};
export default actions;`
myModule/containers/myContainer.js:
`import {useDeps, composeWithTracker, composeAll} from ‘mantra-core’;
import Component from ‘…/components/myComponent’;
export const composer = ({context}, onData) => {
const {Meteor, LocalState} = context();
const user = Meteor.user();
// implementation
};
export const depsMapper = (context, actions) => ({
action1: actions.profile.action1,
action2: actions.profile.action2,
context: () => context
});
};
export default composeAll(
composeWithTracker(composer),
useDeps(depsMapper)
)(Component);`